Relationships
#2609 Dashboard never reconnects after the serve WebSocket closes
Opened by stack72 · 9/28/2026· Shipped 9/28/2026
Problem
If the serve WebSocket closes (serve restart, deploy, network blip), the dashboard replaces every view with "Connecting to swamp serve…" and stays there until the page is reloaded manually. A tab left open across a serve restart never recovers, which matters now that dashboard deep links are shared in chat and incident threads (swamp-club#2595).
Cause
packages/dashboard/src/client/SwampProvider.tsx: ws.onclose clears the socket, sets connected to false and rejects pending requests, but never schedules a reconnect. connect() only runs from the effect keyed on token / authMode, so nothing calls it again after a close.
Reproduction
swamp serve --dashboardand open any dashboard page.- Stop serve, then start it again.
- The page stays on "Connecting to swamp serve…" indefinitely. Reloading fixes it.
Observed while verifying swamp-club#2595; the behaviour is the same on main.
Expected
On an unexpected close, reconnect with capped exponential backoff and jitter, e.g. 0.5s up to 30s. Stop retrying after an auth failure (for example 401/403, or a close code serve uses for auth) and route to the login view instead. Stop on unmount or logout. Once reconnected, views refetch through the existing connected-keyed useRequest effect. Add a unit-testable pure backoff schedule helper.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.