From 092b58cdc20e3ccee1e67d13fc2ebdf5c256669d Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Sun, 25 Oct 2026 09:33:08 +0100 Subject: [PATCH] allow manual connection retry during backoff --- src/App.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.svelte b/src/App.svelte index 0a8ec5b..0114954 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -116,6 +116,7 @@ let authBusy = false; let connectionNotice = ''; let connectionCheckRunning = false; + let connectionCheckGeneration = 0; let realtimeState = 'DISCONNECTED'; let realtimeSocket: WebSocket | undefined; let activityEvents: Array<{ event_id: string; event_type: string; occurred_at: string }> = []; @@ -277,7 +278,7 @@ } async function checkServer() { - if (connectionCheckRunning) return; + const generation = ++connectionCheckGeneration; connectionCheckRunning = true; connectionState = 'CONNECTING'; let attempt = 0; @@ -290,6 +291,7 @@ } else { connectionNotice = 'Connecting to server'; } + if (generation !== connectionCheckGeneration) return; try { const response = await fetch(`${serverAddress}/api/v1/server/info`); if (!response.ok) throw new Error(`HTTP ${response.status}`);