Make post-seek mini-tab resync immune to page age

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
armaan
2026-07-03 21:28:06 +00:00
co-authored by Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 36f32a60e5
commit deef738eeb
2 changed files with 22 additions and 2 deletions
@@ -896,6 +896,24 @@ describe("session-replay-machine", () => {
});
expect(hasEffect(effects, "sync_mini_tabs")).toBe(true);
});
it("resyncs mini tabs after a seek even within the first sync interval of page age", () => {
const state = twoTabReadyState({
playbackMode: "playing",
lastMiniTabSyncWallMs: 0,
});
const afterSeek = dispatch(state, {
type: "SEEK",
globalOffsetMs: 2000,
nowMs: 100,
});
const { effects } = dispatch(afterSeek.state, {
type: "TICK",
nowMs: 300,
activeReplayerLocalTimeMs: 1000,
});
expect(hasEffect(effects, "sync_mini_tabs")).toBe(true);
});
});
describe("areStatesRenderEquivalent", () => {
@@ -960,8 +960,10 @@ export function replayReducer(state: ReplayState, action: ReplayAction): Reducer
suppressAutoFollowUntilWallMs: action.nowMs + 400,
prematureFinishRetryLocalMs: null,
playingWithoutProgressSinceMs: null,
// Reset the throttle so the next TICK re-syncs mini tabs to the new position
lastMiniTabSyncWallMs: 0,
// Reset the throttle so the next TICK re-syncs mini tabs to the new
// position regardless of page age (0 would still throttle during the
// first MINI_TAB_SYNC_INTERVAL_MS after page load).
lastMiniTabSyncWallMs: action.nowMs - MINI_TAB_SYNC_INTERVAL_MS,
playerError: null,
},
effects,