Skip to content

Keep the session's options on a recovery reopen - #223

Merged
bcourbage merged 3 commits into
mainfrom
fix/recovery-reopen-keeps-session-options
Nov 9, 2026
Merged

bcourbage merged 3 commits into
mainfrom
fix/recovery-reopen-keeps-session-options

Conversation

@bcourbage

Copy link
Copy Markdown
Owner

Retry Ignoring Archives, Delete Orphans and Retry, and Rescan Ignoring Archives reopen the profile as a new session, and the reopen was requested with no options. A session scoped with -path Documents recovered by scanning the whole profile, and because ignoring archives makes existing items look new, the widened scan could surface far more than the user chose.

Change

  • The reopen carries the options the session was opened with, exactly (a new read-only sessionArgs on the coordinator, read before the teardown clears them). A picker-opened session has none and reopens with none. Later reconnects replay that same vector.
  • The Ignoring Archives actions no longer edit the profile file. The override is a first-load argument of the reopen request itself: requestOpen takes firstLoadArgs, which ride with the request through the queue, are appended after the session's options for that one load, and are never part of sessionArgs.
  • Session options are applied after the profile loads and the last occurrence of an option wins (checked with launch options: false then true ignores archives, the reverse does not), so the override also beats an explicit -ignorearchives=false.
  • If the request is refused, cancelled or replaced, the override goes with it. A later ordinary open of the profile is not affected, and there is no profile edit to restore. The restore path, its state and its tests are removed (this also drops the restore branch in the fresh-open gate unwind). The launch-time cleanup stays, to strip a suffix an earlier version left behind.

Evidence

  • Isolated fixture, real app: two folders a/ and b/, sync, then change one file on one side. With a session scoped -path a the normal rescan shows Modified → and the recovery scan shows the Created ⚠︎ conflict (archives ignored), covering a/ only. Same result with -path a -ignorearchives=false in the session. P.prf is untouched. On main the recovery scan widened from 1 item to 2.
  • The vector alone was verified before the file edit was removed: the same fixture on a build with the profile write disabled.
  • RecoveryReopenArgsTests (6): scoped recovery carries the options and a picker session carries none; ordinary recovery keeps an explicit -ignorearchives=true or =false unchanged; the action puts the override on its own first load only and leaves the profile unedited; a queued recovery that is cancelled or replaced leaves nothing for a later ordinary open (no override, no edit); a recovery promoted after a remote close overrides its first connect and the same session's reconnect then replays the original vector exactly.
  • Mutations: dropping the override fails the action test; saving the override into the session's options fails the action test and the promotion/reconnect test.
  • D's positive control (Bind the rescan-ignoring-archives confirmation to its session and window #222) now asserts that a confirmed rescan starts the one-shot reopen and leaves the profile unchanged.
  • Full suite on the combined head: 1608 tests, 1 skipped, 0 failures.

Limits

  • A later reconnect after recovery is verified at the coordinator level, not with a live remote reconnect.
  • The per-retry record for the fatal-retry exits and the waiting-window cancel (findings C and H) is separate; with the file edit gone, the profile-restore part of H no longer applies.
  • Not run: the full suite on the final pushed head beyond the local run above; CI will.

🤖 Generated with Claude Code

bcourbage and others added 3 commits November 9, 2026 11:18
Retry Ignoring Archives, Delete Orphans and Retry, and Rescan Ignoring Archives
reopen the profile as a new session, and the reopen was requested with no
options. A session scoped with -path Documents recovered by scanning the whole
profile, and because ignoring archives makes existing items look new, the
widened scan could surface far more than the user chose.

The reopen now carries the options the session was opened with, exactly, read
from the coordinator before the teardown clears them. A picker-opened session
has none and still reopens with none. Later reconnects replay that same
vector.

The Ignoring Archives actions no longer edit the profile file. The override is
a first-load argument of the reopen request itself: requestOpen takes
firstLoadArgs, which ride with the request through the queue, are appended
after the session's options for that one load, and are never part of
sessionArgs. Session options apply after the profile loads and the last
occurrence of an option wins, so the override also beats an explicit
-ignorearchives=false. If the request is refused, cancelled or replaced the
override goes with it, so a later ordinary open of the profile is not affected,
and there is no profile edit to restore. The restore path and its state are
removed; the launch-time cleanup stays to strip a suffix an earlier version
left behind.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… profile alone

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bcourbage
bcourbage merged commit 956091a into main Nov 9, 2026
2 checks passed
@bcourbage
bcourbage deleted the fix/recovery-reopen-keeps-session-options branch November 9, 2026 19:37
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