fix: tab reconnects in a loop after signing in without a page reload (#32341)

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 14:45:25 +02:00 • committed by GitHub
parent 83dcc2dbea
commit c92bc089be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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);