Skip to content

fix(replays): Destroy replayer when switching between video and rrweb replays - #128478

Open
sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/replay-switch-video-rrweb-replayer
Open

sentry[bot] wants to merge 2 commits into
masterfrom
seer/fix/replay-switch-video-rrweb-replayer

Conversation

@sentry

@sentry sentry Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When navigating across a replay playlist (e.g. from a mobile video replay to a web rrweb replay), the ReplayContextProvider remains mounted. replayerRef.current keeps holding the old VideoReplayerWithInteractions instance. The rrweb replayer initialization effect assumes any existing replayer is an rrweb Replayer and attempts to read replayerRef.current.wrapper.parentElement. Because VideoReplayerWithInteractions does not expose a .wrapper property, this throws TypeError: Cannot read properties of undefined (reading 'parentElement').

Similarly, going in the opposite direction (rrweb to video) would cause the video replayer initialization to be skipped entirely because it checks !replayerRef.current.

Fix

  • Track the mounted replayer type (isVideoReplayerRef) in replayContext.tsx.
  • When isVideoReplay changes and no longer matches the mounted replayer, destroy the existing replayer, null out replayerRef.current, and reset player UI state (isPlaying, fastForwardSpeed, isVideoBuffering) that would otherwise remain stale.
  • Allow the respective initialization effects to re-create the correct replayer type.
  • Add unit tests covering switching between video and rrweb replays in both directions, and verifying that UI state like fast-forward speed is reset.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes JAVASCRIPT-3FX8

@sentry <feedback>: Autofix iterates on these changes
@sentry stop iterating: Autofix stops iterating on this run

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@sentry
sentry Bot requested a review from a team as a code owner October 21, 2026 23:11
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 21, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dddf465. Configure here.

@getsantry

getsantry Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Nov 12, 2026

This branch was successfully deployed

1 active deployment
Preview — ecd985e2 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants