fix: tab reconnects in a loop after signing in without a page reload

After signing in on a page without reloading it, the browser tab kept using its signed-out state whenever its live connection had to reconnect. Since 0.12.0 the server drops such a connection as soon as an open chat subscribes to live updates, and the tab reconnected immediately, so after a connection drop (sleep, network change, server restart) it reconnected several times per second until the page was reloaded, putting heavy load on the server. Reconnects now use the current sign-in, so the tab comes back signed in on the first attempt and stays connected.

Fixes #32338
This commit is contained in:
Classic298 2026-10-13 13:29:30 +02:00
parent 93d25dbe3b
commit 9fd0d8f194

View file

@ -183,7 +183,7 @@
randomizationFactor: 0.5,
path: '/ws/socket.io',
transports: enableWebsocket ? ['websocket'] : ['polling', 'websocket'],
auth: { token: localStorage.token }
auth: (cb) => cb({ token: localStorage.token })
});
await socket.set(_socket);