From 9fd0d8f1946983dfabc6fdfc4eb6b8d7049fac6a Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 13 Oct 2026 13:29:30 +0200 Subject: [PATCH] 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 --- src/routes/+layout.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index adf8c17637..d482219f1d 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -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);