Repository navigation
Conversation
A regular file at v<N>.new made save reads and writes fail when cleanup tried to remove it as a directory. Clean up the reserved staging paths according to their file type. Adapted from Vice-Tay 8ffb049 with Codex assistance.
|
Could cleanup be best-effort in AI-assisted with Codex. |
|
Correct on both halves: remove_staged_version dispatches on symlink_metadata (dir / dir-symlink / other), and the recovery sweep now only touches names that parse as v.new so unrelated *.new files survive. Sharing the helper between recovery and commit is the right consolidation. |
|
Independent local verification of PR #2716 (claim Environment: Windows, rustc/cargo 1.100.0, MSVC,
Only pre-existing |
|
@DrDarkDK Done in 520268f: |
|
Independent Windows 11 verification and review of Verification (
|
|
Thanks, @kotekompotek, for reviewing the staging cleanup, and @cloph-dsp and @fuzeofficlal for testing it on Windows. The lock test confirms that the previous save stays readable, the write fails while the staging file is locked, and the retry succeeds after the file is released. I appreciate you checking the base branch and the related PRs as well. |
|
Automated triage for the maintainers. In This is a recommendation for a maintainer to look, not an approval. Generated by Claude Code |
Problem
XGameSave stages a save version in
v<N>.newbefore renaming it tov<N>. If a regular file occupies that staging path,remove_dir_allreturnsNotADirectory(Windows error 267). This can hide the last committed save during recovery and block a new commit.Change
Use the same cleanup for recovery and commit. It removes a staging entry according to its type. Recovery uses the existing canonical version-name parser to clean up
v<N>.newentries and preserve unrelated names such asnotes.new.Verification
mainat13f91cawith the two regression tests applied by themselves, both tests fail withNotADirectory.cargo test -p victory-hle --lib --locked staged_version_filepasses both tests. They cover reading the committed save, preserving an unrelated file, and replacing the stale staging file on commit.cargo test -p victory-hle --lib --lockedpasses all 148 tests.cargo xtask policy --stagedpassed before commit. The tests use temporary files and synthetic data.Follow-up from review
On Windows, a file opened without delete sharing cannot be removed. Recovery now tries to clear an unfinished version without requiring deletion to succeed before reading the committed save. Writing a new version still requires the staging path it will reuse to be clear.
The new test,
a_locked_staged_version_file_only_blocks_commit, failed on the previous PR head with Windows error 32. It now verifies that the old save stays readable whilev2.newis locked, the write fails while the lock is held, and a retry commits the new version after the lock is released. All 149victory-hleunit tests andcargo clippy -p victory-hle --all-targets --all-features --locked -- -D warningspassed.The Windows CI run for
3e5cdb8passed both Clippy checks and the full workspace test suite.Adapted from TaynanGT/VIctory@8ffb049 in #2257. Related #1981 covers recovery when a committed version is missing a blob. Prepared with Codex assistance.