Skip to content

fix(sdk): capture cannot change the app's outcome, and both SDKs coordinate on one page - #2442

Merged
Makisuo merged 16 commits into
fix/audit-worker-envfrom
fix/audit-sdk-capture
Nov 10, 2026
Merged

Makisuo merged 16 commits into
fix/audit-worker-envfrom
fix/audit-sdk-capture

Merge branch 'fix/audit-worker-env' into fix/audit-sdk-capture

95f60d2
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Nov 10, 2026 in 3m 16s

Confidence 10/10 · No issues found

🟢 Confidence 10/10 · safe to merge. All 23 reviewable files of this PR read at 95f60d2; the kickoff's since-then list names audit-log and service-map files this PR does not touch, so those went unread here.
no findings · tests covered · risk medium

Hardens both published browser SDKs: capture can no longer change an app's fetch/XHR outcome, session events are stamped when they happen, and the two SDKs share one page-wide error, vitals and consent state. Behaviour is pinned by new tests in each package; safe to merge.

  • emit stamps timestamp, URL and trace id as an event is buffered, not at flush
  • Effect client claims errors page-wide in captureException and notifies page error listeners
  • init() runs on defaults and returns a no-op handle when startup throws
  • Effect client leases webVitals, gates replay on isLikelyBot, and removes its sanitizer on stop

Production impact

Production traffic of the changed files (last 7 days)
File Calls/day Busiest operations
packages/browser-session/src/replay/capture/network.ts 438 GET 310/day, 0.1% err
GET 128/day, 0.6% err
What was checked
  • Every capture step in wrapFetch/wrapXhrSend is behind quietly, and withStartedTraceId cannot throw on its own (events/trace-id.ts:43)
  • Effect client claims markReported only once a span exists, matching packages/browser/src/errors.ts:59
  • @maple/browser-session and @maple/sdk-core are private, so the changeset needs only the two published packages

95f60d2 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.