From a4204c6adda5b11f850c6a9678f9400ba17f4964 Mon Sep 17 00:00:00 2001 From: ManthanNimodiya Date: Thu, 22 Oct 2026 16:20:19 +0530 Subject: [PATCH] fix(chrome-extension): reset a recording phase left by a failed start A throw from recorder.start() left status recording with no active session, so stop was a no-op and the document never idle-closed. --- apps/chrome-extension/src/offscreen/recorder.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/chrome-extension/src/offscreen/recorder.ts b/apps/chrome-extension/src/offscreen/recorder.ts index 2696dd36d90..c72bc9d2e0b 100644 --- a/apps/chrome-extension/src/offscreen/recorder.ts +++ b/apps/chrome-extension/src/offscreen/recorder.ts @@ -1174,9 +1174,12 @@ const startRecording = async (request: StartRecordingRequest) => { ); await ownedSpool.dispose().catch(() => undefined); } - // Reset the "creating" status so later status syncs do not report a - // phantom in-progress recording. - if (status.phase === "creating") { + // Reset the status this attempt set so later status syncs do not report + // a phantom in-progress recording. "recording" is already set before + // recorder.start(), so a throw there would otherwise leave a capture + // phase with no session behind it: stop becomes a no-op and the idle + // self-close never fires. + if (status.phase === "creating" || status.phase === "recording") { status = isUserCancellationError(error) ? { phase: "idle" } : {