Skip to content

feat(browser): headless user feedback API - #1155

Closed
Makisuo wants to merge 4 commits into
feat/browser-sdk-error-replayfrom
feat/browser-sdk-feedback
Closed

Makisuo wants to merge 4 commits into
feat/browser-sdk-error-replayfrom
feat/browser-sdk-feedback

fix(browser): forget the last error when the SDK restarts

04e5138
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Sep 29, 2026 in 1m 4s

Confidence 5/5 · No issues found

Confidence 5/5 · safe to merge
The reset of lastError in configureFeedback closes the shutdown case the previous review flagged, and the new browser tests exercise it.
quality 100/100 · no findings · tests covered · risk low · 1/1 new units observable

Adds MapleBrowser.sendFeedback, a headless API that emits a maple.user_feedback OTel log event linked to the session, the last error's span and a replay it keeps. The earlier lastError-after-shutdown finding is fixed; the change is contained and safe to merge.

  • sendFeedback emits maple.user_feedback with session.id, user.email/user.name and maple.feedback.* attributes
  • configureFeedback is called from init() and from shutdown(), clearing lastError on either lifecycle start
  • keepReplay runs before has_replay is read, so a buffered replay it keeps is reported

Fixed since the last review

  • F2 · lastError survives shutdown() and links feedback to a dead trace
What was checked
  • F2: shutdown() now calls configureFeedback (init.ts:249), which sets lastError = undefined; the re-init test at feedback.browser.test.ts:88 covers it
  • has_replay timing: keepReplay() precedes the read (feedback.ts:57-58) and trigger calls markReplayTriggered synchronously (replay-session.ts:147-151)
  • user.email drop path matches resolved config: privacy.captureUserEmail → config.captureUserEmail (config.ts:267), tested at feedback.browser.test.ts:98
Observability coverage: 1 of 1 changes observable
Change Kind Observable Evidence
sendFeedback user feedback event log event yes emitLog queues a structured record with session.id and the linked span context, exported through the OTLP logs pipeline (packages/browser/src/deferred/logs.ts:56)

04e5138 · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple to ask about one.