From 7d53e59945f3942cb27d5287c00cc606a2619ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 27 Mar 2022 00:26:11 +0100 Subject: [PATCH] properly clear inactive cursors. --- internal/websocket/manager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/websocket/manager.go b/internal/websocket/manager.go index 47caed03..824da0a2 100644 --- a/internal/websocket/manager.go +++ b/internal/websocket/manager.go @@ -344,6 +344,10 @@ func (manager *WebSocketManagerCtx) startInactiveCursors() { case <-manager.shutdownInactiveCursors: manager.logger.Info().Msg("stopping inactive cursors handler") manager.shutdownInactiveCursors = nil + + // remove last cursor entries and send empty message + _ = manager.sessions.PopCursors() + manager.sessions.InactiveCursorsBroadcast(event.SESSION_CURSORS, []message.SessionCursors{}, nil) return case <-ticker.C: cursorsMap := manager.sessions.PopCursors()