XGameSave: a folder named like a version, such as v01, does not remov… #1006

Closed
NATON4 wants to merge 1 commit from upstream-pr/1006 into main
NATON4 commented 2026-11-24 14:55:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by NATON4 on 2026-11-24T14:55:14Z.


…e the save

Recovery read every folder v<digits> as a committed version, so a v01, v001 or v+1 beside the committed v1 also counted as version 1. One of the two was then "older" and removed by its rebuilt name, v1: the committed save itself. Reading the newest version's manifest then failed with NotFound, which reads as no save at all.

A version's folder is now only v<N> exactly as commit names it (no sign, no leading zeros). Other names are not versions: recovery neither counts nor removes them.

The new test commits a save, adds v01, v001 and v+1 folders, and checks that the save reads back, the strays are left alone and the next update goes on to v2.

Closes #870.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6584622480 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1006). Originally posted by [NATON4](https://github.com/NATON4) on 2026-11-24T14:55:14Z. --- …e the save Recovery read every folder `v<digits>` as a committed version, so a `v01`, `v001` or `v+1` beside the committed `v1` also counted as version 1. One of the two was then "older" and removed by its rebuilt name, `v1`: the committed save itself. Reading the newest version's manifest then failed with NotFound, which reads as no save at all. A version's folder is now only `v<N>` exactly as `commit` names it (no sign, no leading zeros). Other names are not versions: recovery neither counts nor removes them. The new test commits a save, adds `v01`, `v001` and `v+1` folders, and checks that the save reads back, the strays are left alone and the next update goes on to `v2`. Closes #870.
DenRakEiw commented 2026-11-24 15:03:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T15:02:23Z.

Review: APPROVED


Tested merged cleanly onto main (ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):

  • cargo test -p victory-hle: 95 passed, 0 failed (plus no_dll_planting: 1 passed)
  • cargo clippy -p victory-hle --all-targets: 0 warnings
  • cargo xtask policy: ok

Clean fix ensuring non-canonical version-like directories (such as v01) cannot trigger deletion of a committed save during recovery. Approving.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6041717995 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1006#pullrequestreview-6041717995). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T15:02:23Z. **Review:** APPROVED --- Tested merged cleanly onto `main` (`ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC): - `cargo test -p victory-hle`: **95 passed, 0 failed** (plus `no_dll_planting`: 1 passed) - `cargo clippy -p victory-hle --all-targets`: **0 warnings** - `cargo xtask policy`: ok Clean fix ensuring non-canonical version-like directories (such as `v01`) cannot trigger deletion of a committed save during recovery. Approving. AI-assisted (Gemini 4 Neon).
MichaelSmithAI commented 2026-11-24 15:04:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T15:03:28Z.


Verified the canonical-name fix together with the older-save preservation follow-up on Wine 11.22. All nine XGameSave tests passed using temporary saves. Your test exercised a normal update from v1 to v2 with the stray directories still present.

The follow-up covers a separate recovery decision in current(): parse the newest manifest before pruning older committed versions. With an invalid v2 manifest, the read still returned an error and the v1 blob remained intact. After restoring that manifest, the next read returned the v2 blob and cleaned up v1. The two changes compose with the regression test placed alongside this branch’s save tests.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135387751 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1006#issuecomment-7135387751). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-24T15:03:28Z. --- Verified the canonical-name fix together with the [older-save preservation follow-up](https://github.com/THE-PRO-GAME/VIctory/pull/2) on Wine 11.22. All nine XGameSave tests passed using temporary saves. Your test exercised a normal update from v1 to v2 with the stray directories still present. The follow-up covers a separate recovery decision in `current()`: parse the newest manifest before pruning older committed versions. With an invalid v2 manifest, the read still returned an error and the v1 blob remained intact. After restoring that manifest, the next read returned the v2 blob and cleaned up v1. The two changes compose with the regression test placed alongside this branch’s save tests.
mercuryVM commented 2026-11-24 16:04:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T15:16:00Z.

Review: APPROVED


Tested 6a2c18e2 on Windows 11, RTX 5070, MSVC: cargo test -p victory-hle xgamesave 8 passed, including a_folder_named_like_a_version_does_not_remove_the_save.

  • version_number accepting only the canonical form (number.to_string() == digits) closes the hole where v01, v001 or v+1 parsed as version 1 and recovery deleted the real v1 through the rebuilt name. Strays are now neither counted nor removed.
  • The test also checks that the next update still proceeds from the committed version (v1 → v2) with the strays present. That's the regression that mattered.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6041972978 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1006#pullrequestreview-6041972978). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T15:16:00Z. **Review:** APPROVED --- Tested 6a2c18e2 on Windows 11, RTX 5070, MSVC: `cargo test -p victory-hle xgamesave` 8 passed, including `a_folder_named_like_a_version_does_not_remove_the_save`. - `version_number` accepting only the canonical form (`number.to_string() == digits`) closes the hole where `v01`, `v001` or `v+1` parsed as version 1 and recovery deleted the real `v1` through the rebuilt name. Strays are now neither counted nor removed. - The test also checks that the next update still proceeds from the committed version (`v1` → `v2`) with the strays present. That's the regression that mattered. AI-assisted (Claude Code).
Zipettte commented 2026-11-24 16:05:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:12:50Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 6a2c18e: cargo test -p victory-hle passes, 96 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135645500 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1006#issuecomment-7135645500). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T15:12:50Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 6a2c18e: `cargo test -p victory-hle` passes, 96 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
upstream-sync closed this pull request 2026-11-24 20:01:44 +00:00

Pull request closed

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
Marvisak/VIctory!1006
No description provided.