Skip to content

feat(client-runtime): richer reconnect detail and 12h diagnostics log - #163

Merged
patroza merged 1 commit into
fork/changesfrom
t3code/connection-diagnostics-ui
Jul 29, 2026
Merged

feat(client-runtime): richer reconnect detail and 12h diagnostics log#163
patroza merged 1 commit into
fork/changesfrom
t3code/connection-diagnostics-ui

Conversation

@patroza

@patroza patroza commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Show useful disconnect detail in the connection banner (WebSocket close codes like 1006 abnormal, ping timeouts) instead of only the generic disconnected. message.
  • Keep reconnect titles short (Reconnecting... / Connection failed) and put the cause after a middle dot on the status line.
  • Record short-lived connection diagnostics (disconnect / connect_failed / backoff / blocked) to localStorage with a hard 12-hour retention window (max 400 events), plus Effect.logWarning for console/traces.
  • Fix generic diagnostics: onDisconnect was racing the browser close event and ignoring the forked Effect onPingTimeout hook, so every failure looked like t3vm disconnected. Capture SocketError (close codes) + onPingTimeout into a sink before formatting.

Root cause (Jaeger / host, 2026-07-29 storm)

Smart desktop logs showed 22× t3vm disconnects (~08:18–08:49 UTC) almost all as bare transport / t3vm disconnected. After this fix they should say t3vm ping timeout. or closed (1006 abnormal).

Guest Jaeger (t3-server-vm) during the storm:

  • Live WS sessions drown in VCS status work: hundreds of runGitCommand / processRunner spans per connection; subscribeVcsStatus traces multi‑minute.
  • Ticket issue itself is fast (µs–ms); one client saw HTTP websocket-ticket 10s timeout when the guest/event loop was wedged.
  • Host at check time: load ~12, swap full (35G), cloud-hypervisor for t3vm ~200% CPU / 44% RAM — classic thrash → late pongs → Effect client 5s ping kills the socket → reconnect storm.

This PR makes the client truthful and inspectable. Ops follow-ups (not in this PR): guest memory pressure, VCS broadcaster fan-out, optional longer RPC ping interval.

Test plan

  • Focused unit tests: disconnect formatting, diagnostics retention, presentation, supervisor, RPC session (including ping timeout + 1006 paths), cloud presentation
  • vp check
  • Full monorepo typecheck
  • After deploy: reproduce reconnect; banner/log should show ping timeout or close code, not bare disconnected.
  • DevTools t3code:connection-diagnostics:v1 retains events ≤12h

Surface WebSocket close codes and ping timeouts in connection banner text,
and retain short-lived disconnect events in localStorage for later inspection.
@patroza
patroza enabled auto-merge (squash) July 29, 2026 07:07
@patroza
patroza disabled auto-merge July 29, 2026 07:08
@patroza
patroza merged commit 50e6ec0 into fork/changes Jul 29, 2026
9 checks passed
patroza added a commit that referenced this pull request Jul 29, 2026
…#163)

Surface WebSocket close codes and ping timeouts in connection banner text,
and retain short-lived disconnect events in localStorage for later inspection.

Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
patroza added a commit that referenced this pull request Jul 29, 2026
…#163)

Surface WebSocket close codes and ping timeouts in connection banner text,
and retain short-lived disconnect events in localStorage for later inspection.

Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
patroza added a commit that referenced this pull request Jul 29, 2026
…#163)

Surface WebSocket close codes and ping timeouts in connection banner text,
and retain short-lived disconnect events in localStorage for later inspection.

Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
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