Keep a local save made during a cross-file-system download; make concurrent session saves safe #4

Merged
HoroTW merged 2 commits from hakalya/fox-65-exdev-session-save into main 2026-10-12 12:41:24 +00:00 AGit
Collaborator

FOX-65. (1) mirror: the conflict check is repeated after a download was copied across file systems, right before the rename, so a local save made during a long copy is kept as a conflict copy instead of being replaced. Same-file-system path unchanged. (2) session: every write_private call uses a temporary file of its own (two commands sharing a state directory no longer rename each other's session.json.tmp away), cookies.lwp is written to a temporary file and renamed instead of rewritten in place, and the directory is synced after the rename. Three regression tests, each red on main d42feb0; suite 151 OK on 17d539b. 🤖 Generated with Claude Code

FOX-65. (1) mirror: the conflict check is repeated after a download was copied across file systems, right before the rename, so a local save made during a long copy is kept as a conflict copy instead of being replaced. Same-file-system path unchanged. (2) session: every write_private call uses a temporary file of its own (two commands sharing a state directory no longer rename each other's session.json.tmp away), cookies.lwp is written to a temporary file and renamed instead of rewritten in place, and the directory is synced after the rename. Three regression tests, each red on main d42feb0; suite 151 OK on 17d539b. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
With the state directory on another file system a download is copied into
the mirror before it replaces its target. The conflict check ran before
that copy, so a local save made while a large file was being copied was
replaced without a conflict copy. The check now runs again after the copy,
right before the rename; the same-file-system path is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two commands sharing a state directory wrote through the same
session.json.tmp, so one could rename the other's file away and die with
FileNotFoundError (a watcher exited). Each write now uses a temporary file
of its own. The cookie file goes the same way instead of being rewritten
in place, and the directory is synced after the rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HoroTW merged commit 4731aed1eb into main 2026-10-12 12:41:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
HoroTW/icloud-drive-linux!4
No description provided.