Skip to content

Prevent close from losing unsaved restore state - #18

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-management-7f1b
Draft

cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-management-7f1b

Conversation

@cursor

@cursor cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

Bug and impact

When automatic restore persistence failed during close, the daemon still destroyed the live browser and returned success. A full disk, invalid state path, or permission failure could therefore permanently discard fresh cookies and local storage while the CLI only printed “Browser closed.”

Root cause

handle_close retained the save error as response metadata but unconditionally called close_current_browser, then wrapped the failure in a successful response.

Fix

Propagate automatic save failures before browser teardown so the close command fails and the live session remains available for retry. Added an end-to-end regression test that blocks state-directory creation and verifies the browser and its cookie remain intact.

Validation

  • cargo +stable fmt -- --check
  • cargo +stable test e2e_close_aborts_when_restore_state_cannot_be_saved -- --ignored --test-threads=1
  • cargo +stable test (896 unit tests and 2 CLI integration tests passed)
Open in Web View Automation 

cursoragent and others added 2 commits August 17, 2026 11:09
Co-authored-by: seanmcd15 <seanmcd15@gmail.com>
Co-authored-by: seanmcd15 <seanmcd15@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant