Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

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

  1. swamp serve --dashboard and open any dashboard page.
  2. Stop serve, then start it again.
  3. 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.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 8 MOREREVIEW+ 17 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/28/2026, 8:58:42 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack729/28/2026, 7:10:23 PM

Sign in to post a ripple.