Skip to content

Fix infinite loop in replaceActions#122

Merged
ccschmitz merged 1 commit intomasterfrom
hotfix/replace-actions-errors
May 15, 2025
Merged

Fix infinite loop in replaceActions#122
ccschmitz merged 1 commit intomasterfrom
hotfix/replace-actions-errors

Conversation

@ccschmitz
Copy link
Contributor

We were seeing issues getting into an infinite loop calling splice to reset actions (I believe only with large action sets). Replacing the array completely seems to get around this issue.

We were seeing issues getting into an infinite loop calling `splice` to reset actions (I believe only with large action sets). Replacing the array completely seems to get around this issue.
@ccschmitz ccschmitz merged commit 5733499 into master May 15, 2025
5 of 12 checks passed
@ccschmitz ccschmitz deleted the hotfix/replace-actions-errors branch May 15, 2025 14:46
Vadman97 pushed a commit to highlight/highlight that referenced this pull request May 15, 2025
## Summary

A few optimizations to the session replayer:

* Changes how rrweb replaces actions by completely replacing the array
rather than using `splice` to reset it. This seems to fix an infinite
loop we were seeing, though probably has some tradeoffs with creating a
new array rather than reusing the existing.
* Filters out custom events before passing events to rrweb since those
are only used on the timeline, not for replay.
* Adds some mechanisms for creating many track events at once and
viewing very large DOM trees to test those scenarios in
recording/replay.
* Prevents Stripe from loading when any page is rendered in our app and
lazy loads it only when needed on the update plan page.

## How did you test this change?

Click tested locally and in the Reflame preview, which included the
rrweb updates. Compared prod session viewing to the app preview for some
sessions that had obvious playback issues.

## Are there any deployment considerations?

* Need to release highlight/rrweb#122 and update
rrweb in this PR before merging.
* Will need to follow up with customers to let them know replay should
be better (see Jira ticket for details on who to contact).

## Does this work require review from our design team?

N/A
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.

2 participants