Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix replay pausing issue
  • Loading branch information
BilalG1 committed Feb 17, 2026
commit a1da657dd990a04b7c8452fff433aa75df001896
Original file line number Diff line number Diff line change
Expand Up @@ -557,16 +557,18 @@ describe("session-replay-machine", () => {

describe("TOGGLE_PLAY_PAUSE", () => {
it("pauses from playing", () => {
const state = twoTabReadyState({ playbackMode: "playing" });
const state = twoTabReadyState({ playbackMode: "playing", currentGlobalTimeMsForUi: 2500 });
const { state: s, effects } = dispatch(state, { type: "TOGGLE_PLAY_PAUSE", nowMs: 1000 });
expect(s.playbackMode).toBe("paused");
expect(s.pausedAtGlobalMs).toBe(2500);
expect(hasEffect(effects, "pause_all")).toBe(true);
});

it("pauses from gap_fast_forward", () => {
const state = twoTabReadyState({ playbackMode: "gap_fast_forward" });
const state = twoTabReadyState({ playbackMode: "gap_fast_forward", currentGlobalTimeMsForUi: 3000 });
const { state: s } = dispatch(state, { type: "TOGGLE_PLAY_PAUSE", nowMs: 1000 });
expect(s.playbackMode).toBe("paused");
expect(s.pausedAtGlobalMs).toBe(3000);
expect(s.gapFastForward).toBeNull();
});

Expand All @@ -575,9 +577,11 @@ describe("session-replay-machine", () => {
playbackMode: "buffering",
bufferingAtGlobalMs: 1000,
autoResumeAfterBuffering: true,
currentGlobalTimeMsForUi: 1500,
});
const { state: s } = dispatch(state, { type: "TOGGLE_PLAY_PAUSE", nowMs: 1000 });
expect(s.playbackMode).toBe("paused");
expect(s.pausedAtGlobalMs).toBe(1500);
expect(s.bufferingAtGlobalMs).toBeNull();
expect(s.autoResumeAfterBuffering).toBe(false);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ export function replayReducer(state: ReplayState, action: ReplayAction): Reducer
state: {
...state,
playbackMode: "paused",
pausedAtGlobalMs: state.currentGlobalTimeMsForUi,
gapFastForward: null,
bufferingAtGlobalMs: null,
autoResumeAfterBuffering: false,
Expand Down