Skip to content

fix(preview): stabilize background browser automation - #8981

Closed
maria-rcks wants to merge 14 commits into
pingdotgg:mainfrom
maria-rcks:t3code/fix-browser-automation-capture
Closed

maria-rcks wants to merge 14 commits into
pingdotgg:mainfrom
maria-rcks:t3code/fix-browser-automation-capture

fix(preview): restore capture admission after interrupted teardown

6f8df0f
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Correctness Check succeeded Oct 6, 2026 in 4m 42s

No issues identified (1 code object reviewed).

• Reviewed files modified since 386b0a9; other PR files not modified since then were skipped.
• Merge Base: 17c0878
• Head: 6f8df0f

Details

✅ File Path U3 Bytes Comments Posted Reason
➖ apps/desktop/src/preview/Manager.test.ts 1110 Excluded by macroscope ignore file
✅ apps/desktop/src/preview/Manager.ts 1305 0

Billed Total: 10.00KB of diff | $0.40 (This review was charged at our per-review byte minimum of 10.00KB. Learn more here)

Filtered Issues Details

apps/desktop/src/preview/Manager.ts
  • line 3439: If a later teardown drain times out, the main-window close is cancelled (DesktopWindow resets closePreparationRunning on failure), but this eager closeAllPictureInPicture() has already removed the PiP session, updated the tab state to pictureInPicture: false, and closed its child window. The failure handler here only restores debugger sessions; it never restores PiP. Thus a pending native/debugger operation exceeding the 5-second drain timeout unexpectedly terminates an active PiP preview even though the main window remains open. Defer this destructive close until teardown can succeed, or restore the session on the failure path. [ Already posted ]