fix(realtime): open no socket after a logout, and reconnect as soon as the network is back

A connect still waiting for its ws token when the user logged out went on
to open a socket authenticated as that user, which the next login on the
same browser then reused. And a socket in its reconnect backoff waited up
to 30 s after the network came back or the tab became visible. Both
events now reconnect right away.
This commit is contained in:
Maurice
2026-10-07 16:25:00 +02:00
parent f02253a44c
commit 3f9b751ee3
5 changed files with 71 additions and 4 deletions
+1
View File
@@ -17,6 +17,7 @@ vi.mock('../src/api/websocket', () => ({
getSocketId: vi.fn(() => null),
setRefetchCallback: vi.fn(),
setPreReconnectHook: vi.fn(),
reconnectNow: vi.fn(),
addListener: vi.fn(),
removeListener: vi.fn(),
}));