Preserve queued and live saves when an import fails #594

Merged
cnuonr merged 2 commits from upstream-pr/594 into main 2026-11-29 08:16:59 +00:00
cnuonr commented 2026-11-28 01:38:38 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cnuonr on 2026-11-28T01:38:38Z.


What changed

  • Prepare the replacement in a temporary directory alongside the queued save. An extraction or copy failure leaves the queued save available for the next launch. If promotion fails after moving the previous import, restore it or retain it and report its location.
  • Reject a regular ZIP entry in place of a save root. Previously an archive containing only a file named saves reported success even though startup expects a directory.
  • Prepare both live save directories before replacing either. Roll back completed renames if a later directory is blocked. Keep the queue available for a retry and copy the current settings on each attempt.

Verification

  • Two generated ZIP cases reproduced the failures on main. The partial-extraction case also checks that a subsequent valid replacement is applied and stale files from the previous queue are absent.
  • A Windows directory handle without delete sharing reproduces a partial startup import. The regression checks that live progress, storage, and settings survive and that a retry applies both directories while keeping the latest settings.
  • cargo test --locked -p victory-gpu --lib save_share::tests passed all 8 tests on Windows.
  • Verified that the patch applies on top of #584. The tests use generated data.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5535439135 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/594). Originally posted by [cnuonr](https://github.com/cnuonr) on 2026-11-28T01:38:38Z. --- ## What changed - Prepare the replacement in a temporary directory alongside the queued save. An extraction or copy failure leaves the queued save available for the next launch. If promotion fails after moving the previous import, restore it or retain it and report its location. - Reject a regular ZIP entry in place of a save root. Previously an archive containing only a file named `saves` reported success even though startup expects a directory. - Prepare both live save directories before replacing either. Roll back completed renames if a later directory is blocked. Keep the queue available for a retry and copy the current settings on each attempt. ## Verification - Two generated ZIP cases reproduced the failures on `main`. The partial-extraction case also checks that a subsequent valid replacement is applied and stale files from the previous queue are absent. - A Windows directory handle without delete sharing reproduces a partial startup import. The regression checks that live progress, storage, and settings survive and that a retry applies both directories while keeping the latest settings. - `cargo test --locked -p victory-gpu --lib save_share::tests` passed all 8 tests on Windows. - Verified that the patch applies on top of #584. The tests use generated data.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
trustno1-coder/VIctory-NVIDIA!594
No description provided.