Skip to content

Replay mutation DOMException refactor - #1907

Open
eoghanmurray wants to merge 8 commits into
rrweb-io:mainfrom
eoghanmurray:replay-domexception-refactor
Open

Replay mutation DOMException refactor#1907
eoghanmurray wants to merge 8 commits into
rrweb-io:mainfrom
eoghanmurray:replay-domexception-refactor

Conversation

@eoghanmurray

Copy link
Copy Markdown
Collaborator

The previous DOMException try/catch added by me in #620 was added to ensure that an entire mutation didn't cause an exception when a particular removes mutation was not found. This PR:

  • extends this protection to rrdom (exception thrown there doesn't inherit from DOMException)
  • adds similar protection to appendChild (addition) mutations which are likely to happen in same scenario

The scenario is 'degenerate' replay state, e.g. applying mutations against a different fullsnapshot or when a prior mutation is missing, so I haven't added testing as it's not something that we need to care about if other mechanisms are in place to ensure replay integrity.

eoghanmurray and others added 6 commits July 18, 2026 09:52
…nded to warn against was when parent incorrectly resolved to a #text node (a logical error in the fullsnapshot + mutation stream). The explicit instanceof DOMException did not work with rrdom. Replace with an explicit nodeType check
…Id is not the parent; both are caused by the same scenario - applying mutations to the 'wrong' replay state (against a different fullsnapshot or a prior mutation is missing)
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2b5bd50

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

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

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Changes

Size change: +5.73 kB (+0.06%) | Total size: 10431.54 kB

all - 1975.30 kB -> 1976.77 kB (+1.48 kB (+0.07%))
File Base PR Diff
all.cjs 567.78 kB 568.17 kB +399 B (+0.07%)
all.js 567.45 kB 567.84 kB +399 B (+0.07%)
all.umd.cjs 570.99 kB 571.38 kB +399 B (+0.07%)
all.umd.min.cjs 269.09 kB 269.39 kB +315 B (+0.11%)
replay - 1407.10 kB -> 1408.50 kB (+1.39 kB (+0.10%))
File Base PR Diff
replay.cjs 403.84 kB 404.21 kB +377 B (+0.09%)
replay.js 403.75 kB 404.11 kB +377 B (+0.09%)
replay.umd.cjs 406.82 kB 407.19 kB +377 B (+0.09%)
replay.umd.min.cjs 192.70 kB 192.99 kB +293 B (+0.15%)
rrweb - 1913.48 kB -> 1914.96 kB (+1.48 kB (+0.08%))
File Base PR Diff
rrweb.cjs 550.94 kB 551.33 kB +399 B (+0.07%)
rrweb.js 550.64 kB 551.03 kB +399 B (+0.07%)
rrweb.umd.cjs 552.16 kB 552.55 kB +399 B (+0.07%)
rrweb.umd.min.cjs 259.74 kB 260.05 kB +315 B (+0.12%)
rrweb-player - 1643.88 kB -> 1645.27 kB (+1.39 kB (+0.08%))
File Base PR Diff
rrweb-player.cjs 473.37 kB 473.73 kB +377 B (+0.08%)
rrweb-player.js 473.24 kB 473.61 kB +377 B (+0.08%)
rrweb-player.umd.cjs 476.16 kB 476.53 kB +377 B (+0.08%)
rrweb-player.umd.min.cjs 221.11 kB 221.39 kB +293 B (+0.13%)

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