HLE: a look-alike version folder no longer deletes a save (fixes #870) #1035

Closed
github-bot wants to merge 1 commit from gh-pr/1035/head into gh-pr/1035/base
Owner

@⁠acleofe on GitHub · 2026-11-24 15:14 UTC · original
fix/xgamesave-exact-version-names → main · +48 −1 · 1 files · 1 commits · closed without merging

What

current takes a container folder's versions only from names exactly as commit writes them (v1, never v01 or v+1), through a new version_number. Folders that only look like versions are left alone.

Why

strip_prefix('v') then parse::<u64>() accepts v01 and v+1 as version 1. With a committed v1 and a stray v01 beside it (a sync tool, a hand copy, a backup restore), both count as 1: the cleanup removes the older versions by their rebuilt names, v1, so it deletes the real save, and the manifest read then fails and the container reads as empty.

With v01, v1 and v2, v1 is deleted, the second removal fails NotFound, and every read errors, so the title sees no save; its next write commits a new v1 and the read after it deletes that one too. Every later save is lost.

Test

  • a_look_alike_version_folder_loses_no_save: stray v01 and v+1 copies beside a committed version leave it readable, and two later writes are both visible. Fails before this change.
  • version_folder_names_are_exact: accepted and refused names.
  • cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings and cargo test --workspace --locked pass.

🤖 Generated with Claude Code

**@⁠acleofe** on GitHub · 2026-11-24 15:14 UTC · [original](https://github.com/Marvisak/VIctory/pull/1035) `fix/xgamesave-exact-version-names` → `main` · +48 −1 · 1 files · 1 commits · closed without merging ## What `current` takes a container folder's versions only from names exactly as `commit` writes them (`v1`, never `v01` or `v+1`), through a new `version_number`. Folders that only look like versions are left alone. ## Why `strip_prefix('v')` then `parse::<u64>()` accepts `v01` and `v+1` as version 1. With a committed `v1` and a stray `v01` beside it (a sync tool, a hand copy, a backup restore), both count as 1: the cleanup removes the older versions by their rebuilt names, `v1`, so it deletes the real save, and the manifest read then fails and the container reads as empty. With `v01`, `v1` and `v2`, `v1` is deleted, the second removal fails NotFound, and every read errors, so the title sees no save; its next write commits a new `v1` and the read after it deletes that one too. Every later save is lost. ## Test - `a_look_alike_version_folder_loses_no_save`: stray `v01` and `v+1` copies beside a committed version leave it readable, and two later writes are both visible. Fails before this change. - `version_folder_names_are_exact`: accepted and refused names. - `cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings` and `cargo test --workspace --locked` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
current() read any folder that parses as v<number> as that version, so a
stray v01 beside the committed v1 counted as version 1 too, and removing
the older versions by their rebuilt names deleted the real save. Take
only names exactly as commit() writes them; leave other folders alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:17:48 +00:00
github-bot closed this pull request 2026-11-26 04:17:48 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 16:30 UTC · original

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

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 16:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1035#issuecomment-7137773856) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at bff45b7: `cargo test -p victory-hle` passes, 97 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1035
No description provided.