You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(replay): handle fast forwarding for arbitrary position jumps in replayer (#248)
fixes REPLAY-667
fixes REPLAY-558
Previously, fast forwarding through a replay was buggy and inconsistent
if you scrub or jump positions. This is because when users scrub or jump
to arbitrary timestamps, the cached nextUserInteractionEvent and state
become stale and prevent proper re-evaluation of fast forwarding.
We now extend the Replayer class by adding a private function
reevaluateFastForward that will handle arbitrary position jumps.
reevaluateFastForward finds the current event index using binary search,
scans forward to find the next user interaction position, and calculates
the gap of inactivity between them. If the gap is large enough, fast
forwarding is triggered. We call this function if we jump/scrub to a new
position, if the skipInactive config changes, and on starting playback.
Before:
- Large period of inactivity at start never fast fowards
- Clicking to a breadcrumb triggers fastforwarding, but scrubbing or
jumping to that same area doesn't
- Scrubbing back while fastforwarding within the same period of
inactivity loses the fastforwarding but the badge stays up
https://github.com/user-attachments/assets/eac9e993-0946-4666-a40d-239679013c46
After:
- Correctly fast forward at the start
- Scrubbing or jumping to any position triggers the correct
fastforwarding behavior, and the badge is consistent
https://github.com/user-attachments/assets/7700da8a-ed3a-4ca0-9ccb-4fd54fb5be45
0 commit comments