feat(browser): error-triggered session replay (replay.onErrorSampleRate) - #1154
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Sep 29, 2026 in 1m 29s
Confidence 4/5 · No issues found
Confidence 4/5 · likely safe to merge
The reviewed delta is a two-line regex-state fix with a regression test; nothing else changed since the last review.
quality 100/100 · no findings · tests covered · risk medium
Adds replay.onErrorSampleRate: unsampled sessions buffer the last minute of rrweb in memory and upload it, then stream, when an error is recorded. The delta since the last review is the error-filter regex fix, which is correct and tested.
matchesresetsRegExp.lastIndexbeforetest, so ag/yfilter drops every matching errorclaimReplayModerolls a persistedrecord/buffer/offper sessionstartBufferedRecordingholds the last two snapshot segments untildrain()uploads themtrigger()drains the buffer, streams the rest and re-announces the session as recorded
What was checked
pattern.lastIndex = 0precedes everytest; the other regex uses,FRAME_URL.exec(error-filters.ts:48) andEXTENSION_URL.test(:79), carry nogflag- The new test (
error-filters.test.ts:83) calls the realshouldCaptureand fails before the fix, where agiregex keepslastIndex ignore,denyUrlsandallowUrlsall reachtestthroughmatches, so all three lists get the reset
648a5ca · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple to ask about one.
Loading