fix(replay): don't rewrite already-emitted nodes when syncing mirror attributes - #23426
Open
logaretm wants to merge 2 commits into
Open
fix(replay): don't rewrite already-emitted nodes when syncing mirror attributes#23426logaretm wants to merge 2 commits into
logaretm wants to merge 2 commits into
Conversation
…attributes `syncMirrorAttributesFromMutationEvent` mutated the serialized node stored in rrweb's mirror in place. That object is the very same one rrweb emitted in an earlier `adds` payload, so when the event buffer holds events unserialized (`useCompression: false`), the mutation rewrote already recorded history. The worst case is `style`: rrweb emits compact style mutations where the value is a partial diff object rather than the full style string, so an element's recorded inline style could be replaced by just the properties that changed. For a Radix/Floating UI popover that meant losing `position: fixed` and its offsets, and the popover rendering somewhere off screen during playback. Store a copy in the mirror instead of mutating the original, and only sync the attributes that can actually show up in a click breadcrumb.
… the mirror `getAttributesToRecord` is handed rrweb's serialized attributes, which are shared with events that may not be serialized yet, and it was writing the `data-sentry-element` -> `data-sentry-component` fallback back onto them. Derive it on the returned object instead.
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit bb9f1d1. Configure here.
Contributor
size-limit report 📦
|
logaretm
marked this pull request as ready for review
August 13, 2026 20:40
logaretm
requested review from
Lms24 and
msonnb
and removed request for
a team
August 13, 2026 20:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stops the replay mirror sync from rewriting recording events that were already emitted.
rrweb hands us the same serialized node object it put in an earlier
addspayload, andEventBufferArrayholds events unserialized until flush, so patching it in place edited recorded history. Worst case wasstyle, where rrweb sends a partial diff object rather than the full string, which is why Radix popovers lostposition: fixedand rendered off screen. Regressed in #20262. Second commit is the same bug ingetAttributesToRecord, which predates it.closes #23393