From 8a4804f09f0343d6ace712800b01c19f34a3a4eb Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Mon, 17 Feb 2020 22:00:21 -0800 Subject: [PATCH] Log when agent fails to register, but take no further action. --- Agent/Services/DeviceSocket.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Agent/Services/DeviceSocket.cs b/Agent/Services/DeviceSocket.cs index 6c06dc3b..c03b7364 100644 --- a/Agent/Services/DeviceSocket.cs +++ b/Agent/Services/DeviceSocket.cs @@ -62,7 +62,16 @@ namespace Remotely.Agent.Services var device = await Device.Create(ConnectionInfo); - await HubConnection.InvokeAsync("DeviceCameOnline", device); + var result = await HubConnection.InvokeAsync("DeviceCameOnline", device); + + if (!result) + { + // Orgnanization ID wasn't found, or this device is already connected. + // The above can be caused by temporary issues on the server. So we'll do + // nothing here and wait for it to get resolved. + Logger.Write("There was an issue registering with the server. The server might be undergoing maintenance, or the supplied organization ID might be incorrect."); + return; + } if (string.IsNullOrWhiteSpace(ConnectionInfo.ServerVerificationToken)) {