From a46de4662cafea13914ad16de2f66a18a0d3ebdb Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 30 Nov 2025 17:51:27 +0800 Subject: [PATCH] :bug: Fix gateway --- DysonNetwork.Ring/Connection/WebSocketController.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DysonNetwork.Ring/Connection/WebSocketController.cs b/DysonNetwork.Ring/Connection/WebSocketController.cs index c533e1f..09b2777 100644 --- a/DysonNetwork.Ring/Connection/WebSocketController.cs +++ b/DysonNetwork.Ring/Connection/WebSocketController.cs @@ -42,8 +42,8 @@ public class WebSocketController( var accountId = Guid.Parse(currentUser.Id!); var deviceId = currentSession.Challenge?.DeviceId ?? Guid.NewGuid().ToString(); - if (string.IsNullOrEmpty(deviceId)) - return BadRequest("Unable to get device ID from session."); + // TODO temporary fix due to the server update + if (string.IsNullOrEmpty(deviceId)) deviceId = Guid.NewGuid().ToString().Replace("-", ""); if (deviceAlt is not null) deviceId = $"{deviceId}+{deviceAlt}"; @@ -101,9 +101,9 @@ public class WebSocketController( } catch (WebSocketException ex) when (ex.Message.Contains( - "The remote party closed the WebSocket connection without completing the close handshake" - ) - ) + "The remote party closed the WebSocket connection without completing the close handshake" + ) + ) { logger.LogDebug( "WebSocket disconnected with user @{UserName}#{UserId} and device #{DeviceId} - client closed connection without proper handshake", @@ -187,4 +187,4 @@ public class WebSocketController( } } } -} +} \ No newline at end of file