Skip to content

CL-7228 surface presence connection loss in the UI - #604

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-7228-surface-presence-connection-loss-in-the-ui
Sep 4, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-7228-surface-presence-connection-loss-in-the-ui

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

CL-7228 surface presence connection loss.

Fixes CL-7228

The presence SSE stream stays open even when join or heartbeat fails, so
the canvas looked healthy while the client was unjoined. The hook now
subscribes to onError and onRecovered, reports failures with room and
principal context, and shows a quiet reconnecting caption after more
than one retry.
@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Fixes CL-7228

@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Self-review

Verdict: the presence disconnect/degraded-caption plumbing is correct end-to-end (client onRecovered API → hook state machine → canvas pane caption) and matches existing patterns in the file (ref-based options, exactOptionalPropertyTypes-safe spreads). No defects found; nothing needed fixing.

  • DISMISSED: onRecovered fires on every successful join/heartbeat, not only after a prior failure (e.g. first join). Checked call sites — consumers only react to the ok→degraded transition via consecutiveFailuresRef, so the extra no-op recoveries are harmless.
  • DISMISSED: trailing prop on CanvasPaneHeader could in principle collide with another trailing consumer. Checked ArtifactCanvasPane — no other trailing usage in that pane, no conflict.
  • DISMISSED: principalId carried through a ref rather than an effect dependency, so a principal change won't reconnect. Checked — this mirrors the existing onSaved ref pattern in the same hook (comment explains only doc identity should reconnect), consistent with prior art.
  • DISMISSED: docs.md rewrite claims chat-page presence moved to chat.presence SSE (CL-6328) and no longer uses @corbits/presence. Verified via grep — chat-page.tsx has zero references to presence/usePresenceRoom, so the doc update is accurate.

Targeted tests run:

  • bun test test/use-presence-room.test.tsx test/canvas-column.test.tsx (apps/web) — 19 pass, 0 fail
  • bun test src/client.test.ts (packages/presence) — 27 pass, 0 fail
  • bun run typecheck — clean

@linear-code

linear-code Bot commented Sep 4, 2026

Copy link
Copy Markdown

CL-7228

@TheGreatAxios
TheGreatAxios merged commit c1abc89 into main Sep 4, 2026
7 checks passed
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