Skip to content

feat: #857 link captured errors to the recorded session (1.11.0)#6

Merged
emmanuelvulk merged 1 commit into
mainfrom
feat/857-error-session-link
Jun 18, 2026
Merged

feat: #857 link captured errors to the recorded session (1.11.0)#6
emmanuelvulk merged 1 commit into
mainfrom
feat/857-error-session-link

Conversation

@emmanuelvulk

@emmanuelvulk emmanuelvulk commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

Captured client errors now carry the recorded replay session they happened in (vulk-corp/bworlds #857). Ships as 1.11.0 — 1.10.0 was taken by the Supabase identity-bridge release; this is rebased on top of it (the two features are orthogonal).

  • Errors gain sessionId + capturedAt on POST /api/telemetry/errors, stamped at enqueue time so a batch spanning a rotation keeps each error on its true session. Additive fields.
  • New session-state.ts holds the active session id on globalThis (survives CDN-ESM bundle splits); error-capture.ts reads it without importing the rrweb-bearing replay module.
  • Page-load errors are back-stamped when recording starts; failed replay starts scrub fresh-session stamps and clear the id; the queue flushes on visibilitychange → hidden.

Test plan

  • npm run build && npm run type-check && npm test — green (239 passed / 3 todo; coexists with the Supabase-bridge tests).
  • Real end-to-end on the BWorlds stack: yalc-linked this build into a consumer app, recorded a live session, threw uncaught/console/rejection errors during it — all linked both directions (session flagged purely from linked errors; reverse latestSessionId resolves). Origin's replay rework + the identity bridge behaved correctly.

🤖 Generated with Claude Code

Errors captured while replay is recording carry that session's id and capture
timestamp (sessionId/capturedAt on /api/telemetry/errors), stamped at enqueue
time so a batch spanning a rotation stays correct. New session-state.ts holds
the id on globalThis (mirroring identity-state, so it survives CDN-ESM bundle
splits); error-capture reads it without importing the rrweb-bearing replay
module. Page-load errors are back-stamped when recording starts; failed starts
scrub fresh-session stamps and clear the id; the queue flushes on page-hide.

Reconciled onto origin's 1.9.4 replay rework (sequence reservation, idle
continuity, firstChunkAcked, shared identity).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@emmanuelvulk emmanuelvulk force-pushed the feat/857-error-session-link branch from 8b92ef9 to 1563a30 Compare June 18, 2026 13:36
@emmanuelvulk emmanuelvulk changed the title feat: #857 link captured errors to the recorded session feat: #857 link captured errors to the recorded session (1.11.0) Jun 18, 2026
@emmanuelvulk emmanuelvulk merged commit a507b31 into main Jun 18, 2026
2 checks passed
@emmanuelvulk emmanuelvulk deleted the feat/857-error-session-link branch June 18, 2026 13:37
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