Skip to content

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented Nov 14, 2025

Fixes an infinite re-render in replay breadcrumbs when an HTML snippet is displayed and we scroll around quickly.

Due to virtualized rows, we need to tell the virtualizer to update the row dimensions when we show the HTML snippet.
When we scroll away and back, it is possible to hit a race condition where we call updateDimensions infinitely.

Fixes JAVASCRIPT-31G4

Fixes an infinite re-rener in replay breadcrumbs when an HTML snippet is displayed and we scroll around quickly.

Due to virtualized rows, we need to tell the virtualizer to update the row dimensions when we show the HTML snippet.
When we scroll away and back, it is possible to hit a race condition where we call updateDimensions infinitely.

Fixes JAVASCRIPT-31G4
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 14, 2025
@billyvg billyvg marked this pull request as ready for review November 14, 2025 17:39
@billyvg billyvg requested a review from a team as a code owner November 14, 2025 17:39
if (
isPending !== prevExtractState.current ||
(showSnippet && prevShowSnippet.current !== showSnippet)
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Virtualizer dimensions: Incomplete update logic.

The condition (showSnippet && prevShowSnippet.current !== showSnippet) only calls updateDimensions() when showSnippet transitions to true, but not when it transitions to false. This means dimensions won't update when hiding the snippet, potentially leaving the virtualizer with stale dimension data. The condition should be prevShowSnippet.current !== showSnippet without the showSnippet && prefix to handle both transitions.

Fix in Cursor Fix in Web

Copy link
Member Author

@billyvg billyvg Nov 14, 2025

Choose a reason for hiding this comment

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

Correct, you can't hide the snippet.

@billyvg
Copy link
Member Author

billyvg commented Nov 14, 2025

@sentry review

@billyvg billyvg merged commit 6ff0acc into master Nov 20, 2025
50 checks passed
@billyvg billyvg deleted the billy/fix-infinite-rerender-breadcrumbs branch November 20, 2025 16:47
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants