Skip to content

fix(replay): don't rewrite already-emitted nodes when syncing mirror attributes - #23426

Open
logaretm wants to merge 2 commits into
developfrom
awad/replay-mirror-attribute-aliasing
Open

fix(replay): don't rewrite already-emitted nodes when syncing mirror attributes#23426
logaretm wants to merge 2 commits into
developfrom
awad/replay-mirror-attribute-aliasing

Conversation

@logaretm

@logaretm logaretm commented Aug 13, 2026

Copy link
Copy Markdown
Member

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 adds payload, and EventBufferArray holds events unserialized until flush, so patching it in place edited recorded history. Worst case was style, where rrweb sends a partial diff object rather than the full string, which is why Radix popovers lost position: fixed and rendered off screen. Regressed in #20262. Second commit is the same bug in getAttributesToRecord, which predates it.

closes #23393

…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.
@logaretm

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 30.3 kB - -
@sentry/browser - with treeshaking flags 28.47 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.81 kB - -
@sentry/browser (incl. Tracing) 48.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.59 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.46 kB - -
@sentry/browser (incl. Tracing, Replay) 88.04 kB +0.07% +57 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.42 kB +0.08% +61 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 92.76 kB +0.07% +60 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 105.47 kB +0.08% +74 B 🔺
@sentry/browser (incl. Feedback) 47.65 kB - -
@sentry/browser (incl. sendFeedback) 35.13 kB - -
@sentry/browser (incl. FeedbackAsync) 40.28 kB - -
@sentry/browser (incl. Metrics) 31.24 kB - -
@sentry/browser (incl. Logs) 31.52 kB - -
@sentry/browser (incl. Metrics & Logs) 32.15 kB - -
@sentry/react 32.09 kB - -
@sentry/react (incl. Tracing) 50.77 kB - -
@sentry/vue 35.34 kB - -
@sentry/vue (incl. Tracing) 50.54 kB - -
@sentry/svelte 30.33 kB - -
CDN Bundle 31.61 kB - -
CDN Bundle (incl. Tracing) 48.9 kB - -
CDN Bundle (incl. Logs, Metrics) 33.8 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.82 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.37 kB +0.09% +62 B 🔺
CDN Bundle (incl. Tracing, Replay) 86.53 kB +0.07% +56 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.36 kB +0.07% +53 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.25 kB +0.07% +60 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.18 kB +0.06% +55 B 🔺
CDN Bundle - uncompressed 93.84 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.75 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 100.14 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.44 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.2 kB +0.06% +125 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.13 kB +0.05% +125 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.81 kB +0.05% +125 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.83 kB +0.05% +125 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.5 kB +0.05% +125 B 🔺
@sentry/nextjs (client) 53.29 kB - -
@sentry/sveltekit (client) 49 kB - -
@sentry/core/server 65.38 kB - -
@sentry/core/browser 51.72 kB - -
@sentry/node 117.03 kB - -
@sentry/node/import (ESM hook with diagnostics-channel injection) 0 B added added
@sentry/node - without tracing 81.43 kB - -
@sentry/aws-serverless 90.92 kB +0.01% +1 B 🔺
@sentry/cloudflare (withSentry) - minified 213.98 kB - -
@sentry/cloudflare (withSentry) 528.93 kB - -

View base workflow run

@logaretm
logaretm marked this pull request as ready for review August 13, 2026 20:40
@logaretm
logaretm requested a review from a team as a code owner August 13, 2026 20:40
@logaretm
logaretm requested review from Lms24 and msonnb and removed request for a team August 13, 2026 20:40
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.

Session Replay: Radix portalled popovers missing after 10.48.0 (still broken on 10.69)

1 participant