HLE: reject saves whose committed container lacks a manifest #570

Closed
Quat3rnion wants to merge 1 commit from upstream-pr/570 into main
Quat3rnion commented 2026-11-24 05:04:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T05:04:39Z.


What

current() reported a missing manifest with NotFound, the same error as a
container that does not exist. An update then treated that as a fresh
container, committed a new v1 and returned S_OK, while readers still chose
the malformed newest version and the main flow deleted the new v1. A version
directory that exists must have a readable manifest; anything else is now
InvalidData, which both readers and submit map to NO_ACCESS.

An AI tool wrote part of this change.

Tested

  • Linux: cargo test --workspace: 165 passed, 0 failed, 3 ignored. A tempdir regression commits two versions, removes the newest manifest, submits an update and checks NO_ACCESS with no third version created.
  • Windows cross-build: cargo check --target x86_64-pc-windows-gnu --workspace --tests passes. No Windows host here.
  • cargo xtask policy passes (150 files ok). No game files or data from them were added.

Checklist

  • Workspace tests and Windows cross-check pass.
  • cargo xtask policy passes. No game files or data from them were added.
  • AI authorship is disclosed above.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6575038872 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/570). Originally posted by [Quat3rnion](https://github.com/Quat3rnion) on 2026-11-24T05:04:39Z. --- ## What `current()` reported a missing manifest with `NotFound`, the same error as a container that does not exist. An update then treated that as a fresh container, committed a new v1 and returned `S_OK`, while readers still chose the malformed newest version and the main flow deleted the new v1. A version directory that exists must have a readable manifest; anything else is now `InvalidData`, which both readers and submit map to `NO_ACCESS`. An AI tool wrote part of this change. ## Tested - Linux: `cargo test --workspace`: 165 passed, 0 failed, 3 ignored. A tempdir regression commits two versions, removes the newest manifest, submits an update and checks `NO_ACCESS` with no third version created. - Windows cross-build: `cargo check --target x86_64-pc-windows-gnu --workspace --tests` passes. No Windows host here. - `cargo xtask policy` passes (150 files ok). No game files or data from them were added. ## Checklist - [x] Workspace tests and Windows cross-check pass. - [x] `cargo xtask policy` passes. No game files or data from them were added. - [x] AI authorship is disclosed above.
mercuryVM commented 2026-11-24 09:05:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:26:50Z.

Review: APPROVED


Tested edbd1a7 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed), including a_committed_container_without_its_manifest_is_rejected.

The distinction is the right one. NotFound must mean "no container", but a version directory without its manifest is a damaged commit. Mapping every manifest read failure to InvalidData makes update return NO_ACCESS instead of quietly starting a new v1 over a damaged save that readers would still pick. The test checks that no new version directory appears.

No issues found.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6035899295 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/570#pullrequestreview-6035899295). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T08:26:50Z. **Review:** APPROVED --- Tested edbd1a7 on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (265 passed, 0 failed), including `a_committed_container_without_its_manifest_is_rejected`. The distinction is the right one. `NotFound` must mean "no container", but a version directory without its manifest is a damaged commit. Mapping every manifest read failure to `InvalidData` makes `update` return `NO_ACCESS` instead of quietly starting a new v1 over a damaged save that readers would still pick. The test checks that no new version directory appears. No issues found. AI-assisted (Claude Code).
geiyiliyabumo commented 2026-11-24 13:02:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T12:22:34Z.


Independent verification & code review on Windows 11 x64 MSVC (merged onto main ffe310e):

Checks Run

  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-hle --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-hle --locked -- xgamesave: PASS (8/8 tests, including a_committed_container_without_its_manifest_is_rejected)

Review

Looks clean and ready to merge — once a committed v<n> directory exists, failing to read its manifest now produces InvalidData instead of propagating NotFound into current_named, preventing updates from treating a corrupted container as empty and committing a stray v1.

AI-assisted; synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7131350525 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/570#issuecomment-7131350525). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T12:22:34Z. --- Independent verification & code review on Windows 11 x64 MSVC (merged onto `main` `ffe310e`): ### Checks Run - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy -p victory-hle --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-hle --locked -- xgamesave`: **PASS** (`8/8` tests, including `a_committed_container_without_its_manifest_is_rejected`) ### Review Looks clean and ready to merge — once a committed `v<n>` directory exists, failing to read its `manifest` now produces `InvalidData` instead of propagating `NotFound` into `current_named`, preventing updates from treating a corrupted container as empty and committing a stray `v1`. *AI-assisted; synthetic tests only, no game files.*
upstream-sync closed this pull request 2026-11-25 01:04:16 +00:00
Marvisak commented 2026-11-25 01:07:45 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:25:12Z.


Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #1729. A version folder without a manifest is refused instead of being taken for a missing container; #1729 changes the same lines and fixes more (falls back to the newest readable version, never prunes below an unreadable one).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148490234 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/570#issuecomment-7148490234). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:25:12Z. --- Automated triage for the maintainers. Closing because another open pull request covers the same change. See #1729. A version folder without a manifest is refused instead of being taken for a missing container; #1729 changes the same lines and fixes more (falls back to the newest readable version, never prunes below an unreadable one). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

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