Skip to content

fix(ws): add 25s server-side Ping heartbeat on terminal/preview WebSockets and fix split-pane reconnect UI - #744

Merged
chareice merged 1 commit into
mainfrom
fix/terminal-ws-heartbeat-and-reconnect-ui
Nov 28, 2026
Merged

chareice merged 1 commit into
mainfrom
fix/terminal-ws-heartbeat-and-reconnect-ui

Conversation

@chareice

Copy link
Copy Markdown
Collaborator

Eliminates the 60s idle disconnect/reconnect storm on /ws/terminal/... and /ws/terminal-previews and fixes misleading single-pane reconnect badges:

  • Hub server-side Ping heartbeat (crates/hub/src/ws.rs): Sends WebSocket Message::Ping every 25s on /ws/terminal/{machine_id}/{terminal_id} and /ws/terminal-previews so idle terminal sockets survive 60s intermediate proxy/NAT timeouts (e.g. Nginx/CLB) instead of disconnecting ~18 attaches/minute.
  • Accurate split-pane reconnect indicator (TerminalCard.web.tsx): Gate only global eventsReconnecting on reconnectIndicatorActive; per-pane terminalReconnecting now reflects each pane's own socket state independently.
  • Instant resume reconnect (TerminalCanvas.web.tsx & TerminalView.native.tsx): Pass resumeDelayMs: 0 to the /ws/events reconnect controller and wire visibilitychange / pageshow into TerminalView.native.tsx's reconnect.handleVisibilityChange so waking from sleep/background detects half-open sockets immediately.

@chareice
chareice merged commit 83f74bf into main Nov 28, 2026
12 checks passed
@chareice
chareice deleted the fix/terminal-ws-heartbeat-and-reconnect-ui branch November 28, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant