diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/session-replays/session-replay-machine.test.ts b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/session-replays/session-replay-machine.test.ts index 7899f3736..fac75d1a8 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/session-replays/session-replay-machine.test.ts +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/session-replays/session-replay-machine.test.ts @@ -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", () => { diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/session-replays/session-replay-machine.ts b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/session-replays/session-replay-machine.ts index 63a3b1cd1..ca34f04e9 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/session-replays/session-replay-machine.ts +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/session-replays/session-replay-machine.ts @@ -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,