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

Closed
acleofe wants to merge 1 commit from upstream-pr/1035 into main
acleofe commented 2026-11-24 15:14:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by acleofe on 2026-11-24T15:14:34Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6585029166 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1035). Originally posted by [acleofe](https://github.com/acleofe) on 2026-11-24T15:14:34Z. --- ## 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)
upstream-sync closed this pull request 2026-11-24 17:03:02 +00:00
Zipettte commented 2026-11-24 17:04:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T16:30:30Z.


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).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137773856 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1035#issuecomment-7137773856). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T16:30:30Z. --- 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

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!1035
No description provided.