mirror of
https://github.com/stack-auth/stack.git
synced 2026-07-20 21:29:36 +08:00
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:
co-authored by
Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent
36f32a60e5
commit
deef738eeb
+18
@@ -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", () => {
|
||||
|
||||
+4
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user