-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(replay): Fixes Firefox playback issues #81199
Conversation
... due to shared object references in `replayStepper`. This happens on Replay details page where we have the replayer as well as a tab that uses `replayStepper` (e.g. Breadcrumbs). Both `Replayer` instances were access the same rrweb event object references and because `replayStepper` plays through the entire replay as fast as possible, it ends up mutating the event objects that the player instance later reads. This ends up causing issues in the playback (like screens not updating so the replay appears frozen and broken). We now deep clone the events in `createHiddenPlayer` to avoid the above situation.
// Replay details player and a hidden player via `replayStepper`) can cause | ||
// playback issues as the object references are the same, even though the | ||
// arrays are not. | ||
structuredClone(rrwebEvents), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://caniuse.com/?search=structuredClone (supported by 94% of browsers)
Bundle ReportChanges will increase total bundle size by 14.48kB (0.05%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #81199 +/- ##
=======================================
Coverage 80.32% 80.32%
=======================================
Files 7215 7215
Lines 319443 319465 +22
Branches 20773 20775 +2
=======================================
+ Hits 256583 256612 +29
+ Misses 62466 62459 -7
Partials 394 394 |
... due to shared object references in `replayStepper`. This happens on Replay details page where we have the replayer as well as a tab that uses `replayStepper` (e.g. Breadcrumbs). Both `Replayer` instances were access the same rrweb event object references and because `replayStepper` plays through the entire replay as fast as possible, it ends up mutating the event objects that the player instance later reads. This ends up causing issues in the playback (like screens not updating so the replay appears frozen and broken). I don't know exactly what mutations are happening that cause the playback issues, nor do I know why it only affects Firefox and not Chrome. We now deep clone the events in `createHiddenPlayer` to avoid the above situation. We first realized this was an issue with `replayStepper` due to #80681 and [its fix](#80697). The events in our hidden replayer were affecting our main playback which indicates that there was some shared state happening. h/t @ryan953 for the suggestion re: object mutations! Closes getsentry/sentry-javascript#14381 Closes getsentry/sentry-javascript#12978
... due to shared object references in `replayStepper`. This happens on Replay details page where we have the replayer as well as a tab that uses `replayStepper` (e.g. Breadcrumbs). Both `Replayer` instances were access the same rrweb event object references and because `replayStepper` plays through the entire replay as fast as possible, it ends up mutating the event objects that the player instance later reads. This ends up causing issues in the playback (like screens not updating so the replay appears frozen and broken). I don't know exactly what mutations are happening that cause the playback issues, nor do I know why it only affects Firefox and not Chrome. We now deep clone the events in `createHiddenPlayer` to avoid the above situation. We first realized this was an issue with `replayStepper` due to #80681 and [its fix](#80697). The events in our hidden replayer were affecting our main playback which indicates that there was some shared state happening. h/t @ryan953 for the suggestion re: object mutations! Closes getsentry/sentry-javascript#14381 Closes getsentry/sentry-javascript#12978
... due to shared object references in
replayStepper
. This happens on Replay details page where we have the replayer as well as a tab that usesreplayStepper
(e.g. Breadcrumbs). BothReplayer
instances were access the same rrweb event object references and becausereplayStepper
plays through the entire replay as fast as possible, it ends up mutating the event objects that the player instance later reads. This ends up causing issues in the playback (like screens not updating so the replay appears frozen and broken). I don't know exactly what mutations are happening that cause the playback issues, nor do I know why it only affects Firefox and not Chrome.We now deep clone the events in
createHiddenPlayer
to avoid the above situation.We first realized this was an issue with
replayStepper
due to #80681 and its fix. The events in our hidden replayer were affecting our main playback which indicates that there was some shared state happening. h/t @ryan953 for the suggestion re: object mutations!Closes getsentry/sentry-javascript#14381
Closes getsentry/sentry-javascript#12978