Skip to content

feat(web): reconnecting badge and reload prompt for degraded sse stream - #3467

Merged
tyler-dane merged 1 commit into
mainfrom
claude/sse-connection-health-alerting-de5182
Sep 7, 2026
Merged

feat(web): reconnecting badge and reload prompt for degraded sse stream#3467
tyler-dane merged 1 commit into
mainfrom
claude/sse-connection-health-alerting-de5182

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

No linked issue. Observability fix from the PostHog sse_connection_degraded signal (error_type: server_closed | timeout).

What and why

The live-update EventSource (GET /api/events/stream) already reports sse_connection_degraded to PostHog after 15s non-OPEN, but the only UI was the sidebar status text, which loses to saving/sync status and disappears with a collapsed sidebar. Users saw a normal-looking calendar that had quietly stopped updating.

  • sse.client.ts now stores when degradation began (getSseDegradedSinceMs) instead of a boolean; isSseDegraded and the sidebar/Settings callers are unchanged.
  • New LiveUpdatesStatus in the shared CalendarHeader: a pulsing dot plus "Reconnecting…" while degraded, cleared on the stream's open. After 30s it adds a Refresh control that reloads the page, because native EventSource never retries once the browser marks it CLOSED (the server_closed case). As with UpdateAvailableButton, the tooltip and the blocked-click pointer hint name Mod+R, since the calendar is keyboard-only.
  • Docs: launch-ops-checklist.md now lists the three live PostHog alerts.

PostHog (created via MCP, not in this diff):

Verified in the local preview by driving the degraded store: badge appears, Refresh appears after the 30s mark, the button carries data-pointer-shortcut=["Mod","R"], and both the header badge and sidebar status clear when the store resets.

Verify

VERDICT: FAIL locally (macOS). Checks run: lint (semantic-colors, agent-constraints, biome), knip, type-check, web unit (800 tests, 0 failures), a11y and e2e Playwright.

All 16 Playwright failures are the documented local-macOS false failures, not regressions: 15 are getByRole('dialog', { name: 'Settings' }) never appearing because booking-harness.ts presses Control+Comma (Meta+Comma on macOS), and 1 is the hold-Mod page-jump hints in account-page-jump.spec.ts. Same classes as #3407-#3410; CI (Linux, one worker) is the gate. Every other check passed.

🤖 Generated with Claude Code

…tream degrades

The live-update EventSource already reported sse_connection_degraded to
PostHog after 15s non-OPEN, but the only UI was the sidebar status text,
which loses to saving/sync status and hides with the sidebar. Users saw a
normal calendar that had silently stopped updating.

The SSE client now records when degradation began instead of a boolean.
CalendarHeader renders a pulsing "Reconnecting…" badge while degraded and,
after 30s, a Refresh control that reloads the page, since native
EventSource never retries once the browser marks it CLOSED. Like
UpdateAvailableButton, the tooltip and blocked-click hint name Mod+R
because the calendar is keyboard-only.

Also documents the three live PostHog alerts, including the new hourly
"SSE connection degraded burst (production)" alert (more than 3 events in
a trailing 60 minutes).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@tyler-dane
tyler-dane marked this pull request as ready for review September 7, 2026 17:13
@tyler-dane tyler-dane added the agent-automerge Agent-loop finished; merge-guard may squash-merge label Sep 7, 2026
@tyler-dane
tyler-dane enabled auto-merge September 7, 2026 17:13
@tyler-dane
tyler-dane added this pull request to the merge queue Sep 7, 2026
Merged via the queue into main with commit 1e4e654 Sep 7, 2026
32 checks passed
@tyler-dane
tyler-dane deleted the claude/sse-connection-health-alerting-de5182 branch September 7, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-automerge Agent-loop finished; merge-guard may squash-merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant