Skip to content

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

Draft
logaretm wants to merge 2 commits into
v10from
awad/v10-replay-mirror-attribute-aliasing
Draft

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

Conversation

@logaretm

@logaretmlogaretm commented Aug 25, 2026

Copy link
Copy Markdown
Member

Backport of: #23426

…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.
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.75 kBaddedadded
@sentry/browser - with treeshaking flags26.19 kBaddedadded
@sentry/browser (incl. Tracing)46.6 kBaddedadded
@sentry/browser (incl. Tracing + Span Streaming)48.39 kBaddedadded
@sentry/browser (incl. Tracing, Profiling)51.36 kBaddedadded
@sentry/browser (incl. Tracing, Replay)85.89 kBaddedadded
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags75.53 kBaddedadded
@sentry/browser (incl. Tracing, Replay with Canvas)90.62 kBaddedadded
@sentry/browser (incl. Tracing, Replay, Feedback)103.26 kBaddedadded
@sentry/browser (incl. Feedback)44.92 kBaddedadded
@sentry/browser (incl. sendFeedback)32.54 kBaddedadded
@sentry/browser (incl. FeedbackAsync)37.68 kBaddedadded
@sentry/browser (incl. Metrics)28.83 kBaddedadded
@sentry/browser (incl. Logs)29.06 kBaddedadded
@sentry/browser (incl. Metrics & Logs)29.75 kBaddedadded
@sentry/react29.56 kBaddedadded
@sentry/react (incl. Tracing)48.86 kBaddedadded
@sentry/vue33.18 kBaddedadded
@sentry/vue (incl. Tracing)48.57 kBaddedadded
@sentry/svelte27.77 kBaddedadded
CDN Bundle30.14 kBaddedadded
CDN Bundle (incl. Tracing)48.57 kBaddedadded
CDN Bundle (incl. Logs, Metrics)31.72 kBaddedadded
CDN Bundle (incl. Tracing, Logs, Metrics)49.87 kBaddedadded
CDN Bundle (incl. Replay, Logs, Metrics)71.05 kBaddedadded
CDN Bundle (incl. Tracing, Replay)86.13 kBaddedadded
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)87.43 kBaddedadded
CDN Bundle (incl. Tracing, Replay, Feedback)91.93 kBaddedadded
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)93.2 kBaddedadded
CDN Bundle - uncompressed89.87 kBaddedadded
CDN Bundle (incl. Tracing) - uncompressed146.79 kBaddedadded
CDN Bundle (incl. Logs, Metrics) - uncompressed94.58 kBaddedadded
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed150.77 kBaddedadded
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed219.47 kBaddedadded
CDN Bundle (incl. Tracing, Replay) - uncompressed266.15 kBaddedadded
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed270.12 kBaddedadded
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed279.86 kBaddedadded
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed283.81 kBaddedadded
@sentry/nextjs (client)51.41 kBaddedadded
@sentry/sveltekit (client)47.02 kBaddedadded
@sentry/core/server80.61 kBaddedadded
@sentry/core/browser66.84 kBaddedadded
@sentry/node-core63.27 kBaddedadded
@sentry/node125.91 kBaddedadded
@sentry/node (incl. diagnostics channel injection)151.34 kBaddedadded
@sentry/node/import (ESM hook with diagnostics-channel injection)70.03 kBaddedadded
@sentry/node/light51.43 kBaddedadded
@sentry/node - without tracing74.95 kBaddedadded
@sentry/aws-serverless84.22 kBaddedadded
@sentry/cloudflare (withSentry) - minified202.05 kBaddedadded
@sentry/cloudflare (withSentry)496.75 kBaddedadded

Sign up for freeto 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

@logaretm