From 815c8fb84ca6f71bb281ad4d4d24033798f7adaa Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Sat, 2 May 2026 22:18:39 +0500 Subject: [PATCH] sync: log on disconnect --- Notesnook.API/Hubs/SyncV2Hub.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Notesnook.API/Hubs/SyncV2Hub.cs b/Notesnook.API/Hubs/SyncV2Hub.cs index f3b625c..74150f0 100644 --- a/Notesnook.API/Hubs/SyncV2Hub.cs +++ b/Notesnook.API/Hubs/SyncV2Hub.cs @@ -122,6 +122,19 @@ namespace Notesnook.API.Hubs await base.OnConnectedAsync(); } + public override async Task OnDisconnectedAsync(Exception? exception) + { + if (exception != null) + { + Logger.LogWarning(exception, "Connection {ConnectionId} disconnected with error (server-side drop)", Context.ConnectionId); + } + else + { + Logger.LogInformation("Connection {ConnectionId} disconnected cleanly (client-initiated)", Context.ConnectionId); + } + await base.OnDisconnectedAsync(exception); + } + public async Task PushItems(string deviceId, SyncTransferItemV2 pushItem) {