Skip to content

fix(browser-client): flush queued events when stopping - #2032

Open
roggernaut wants to merge 2 commits into
rrweb-io:browser-client-ws-resumefrom
roggernaut:codex/browser-client-recording-lifecycle
Open

roggernaut wants to merge 2 commits into
rrweb-io:browser-client-ws-resumefrom
roggernaut:codex/browser-client-recording-lifecycle

Conversation

@roggernaut

@roggernaut roggernaut commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Depends on #2016.

An account or workspace switch can start a new recording in the same tab while events are still queued for the old one. By default, stop() discards those queued events.

Opt in with retireBufferedEvents: true to flush queued events under the old recording ID on stop. A failed POST leaves unread events eligible to send and does not requeue the attempted batch.

Verified in Chromium and covered by a regression test for a lost acknowledgment.


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@changeset-bot

changeset-bot Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e79c7dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@rrweb/browser-client Patch
@rrweb/all Patch
@rrweb/packer Patch
@rrweb/record Patch
@rrweb/replay Patch
rrdom-nodejs Patch
rrdom Patch
rrvideo Patch
rrweb-player Patch
rrweb-snapshot Patch
rrweb Patch
@rrweb/types Patch
@rrweb/utils Patch
@rrweb/web-extension Patch
@rrweb/rrweb-plugin-canvas-webrtc-record Patch
@rrweb/rrweb-plugin-canvas-webrtc-replay Patch
@rrweb/rrweb-plugin-console-record Patch
@rrweb/rrweb-plugin-console-replay Patch
@rrweb/rrweb-plugin-network-record Patch
@rrweb/rrweb-plugin-network-replay Patch
@rrweb/rrweb-plugin-sequential-id-record Patch
@rrweb/rrweb-plugin-sequential-id-replay Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@roggernaut
roggernaut marked this pull request as ready for review November 22, 2026 16:05
@pkg-pr-new

pkg-pr-new Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
@rrweb/all

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/all@e79c7dc

@rrweb/browser-client

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/browser-client@e79c7dc

@rrweb/packer

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/packer@e79c7dc

@rrweb/record

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/record@e79c7dc

@rrweb/replay

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/replay@e79c7dc

rrdom

npm i https://pkg.pr.new/rrweb-io/rrweb/rrdom@e79c7dc

rrdom-nodejs

npm i https://pkg.pr.new/rrweb-io/rrweb/rrdom-nodejs@e79c7dc

rrvideo

npm i https://pkg.pr.new/rrweb-io/rrweb/rrvideo@e79c7dc

rrweb

npm i https://pkg.pr.new/rrweb-io/rrweb@e79c7dc

rrweb-player

npm i https://pkg.pr.new/rrweb-io/rrweb/rrweb-player@e79c7dc

rrweb-snapshot

npm i https://pkg.pr.new/rrweb-io/rrweb/rrweb-snapshot@e79c7dc

@rrweb/types

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/types@e79c7dc

@rrweb/utils

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/utils@e79c7dc

@rrweb/rrweb-plugin-canvas-webrtc-record

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/rrweb-plugin-canvas-webrtc-record@e79c7dc

@rrweb/rrweb-plugin-canvas-webrtc-replay

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/rrweb-plugin-canvas-webrtc-replay@e79c7dc

@rrweb/rrweb-plugin-console-record

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/rrweb-plugin-console-record@e79c7dc

@rrweb/rrweb-plugin-console-replay

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/rrweb-plugin-console-replay@e79c7dc

@rrweb/rrweb-plugin-network-record

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/rrweb-plugin-network-record@e79c7dc

@rrweb/rrweb-plugin-network-replay

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/rrweb-plugin-network-replay@e79c7dc

@rrweb/rrweb-plugin-sequential-id-record

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/rrweb-plugin-sequential-id-record@e79c7dc

@rrweb/rrweb-plugin-sequential-id-replay

npm i https://pkg.pr.new/rrweb-io/rrweb/@rrweb/rrweb-plugin-sequential-id-replay@e79c7dc

commit: e79c7dc

@roggernaut roggernaut changed the title fix(browser-client): isolate transport across recording restarts fix(browser-client): flush queued events when stopping Nov 23, 2026
@roggernaut
roggernaut changed the base branch from main to browser-client-ws-resume November 23, 2026 10:00
@roggernaut
roggernaut force-pushed the codex/browser-client-recording-lifecycle branch from 357c1ff to 1c43a7c Compare November 23, 2026 10:00
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.

[Bug]: @rrweb/browser-client: secondary recordings upload empty (wsConnectionPaused left true after stop())

1 participant