XGameSave: an unreadable legacy blob keeps the old layout #383
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/383"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from fxceless/victory-fork. Originally posted by JordanFableFur on 2026-11-25T00:12:54Z.
What
The legacy-to-versioned migration's iterator chain skipped a blob it could not read and committed the rest: a legacy directory with one unreadable file moved over with that blob silently dropped, and the old directory was removed, so the save lost data for good.
The migration now fails whole when a recognized blob cannot be read: the old directory keeps its files so a later call can retry, and unrelated names stay skipped (the optional
.displaymetadata behaves as before).Fixes #242.
Testing
A regression (unix-gated: it uses file permissions) makes one of two blobs unreadable, opens the provider, and checks the old layout is untouched; with the permission restored, a retry migrates both blobs and removes the old directory. The existing migration test is unchanged and passes.
Validated on Windows CI (fork-run of the repository workflow): clippy both builds and the full test suite pass: https://github.com/JordanFableFur/victory-fork/actions/runs/45515840303
AI use: written with Codex and Claude Code (GPT-5.2 Codex); reviewed and posted with my approval. No game files were used.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:16:37Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
3ae02f70b1ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:13:05Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
3ae02f7ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
Imported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T00:24:55Z.
Duplicate of #322?
Imported from fxceless/victory-fork. Originally posted by JordanFableFur on 2026-11-25T00:33:00Z.
Both findings addressed in ff1da6c:
Update::submitrefuses while a legacy directory of the container's name sits under the root (the migration has not gone through), so an update can no longer commit a version that leaves the legacy blobs out; the regression checks the refusal, and the retry path still migrates both blobs.Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:16:37Z.
Code review location:
crates/victory-hle/src/modules/xgamesave.rs; line 319When a blob is unreadable, this returns
None, butProvider::openstill succeeds and reads reportBLOB_NOT_FOUND. If the title then submits an update,Update::submitcommits a fresh v1 containing only the submitted blobs. The nextcontainers()scan treats that version as a completed migration and deletes the legacy directory, losing even its readable, unmodified blobs. An isolated run with readableData, unreadableHeader, and an update writingNewleaves onlyNew; the parent preservesData. Propagate the migration failure or reject writes to the affected container until migration succeeds instead of treating it as missing.Useful? React with 👍 / 👎.
Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T00:16:37Z.
Code review location:
crates/victory-hle/src/modules/xgamesave.rs; line 1172When this test runs with permission-bypassing privileges, such as root in a default Linux container, mode
000does not prevent reading the file. Consequently,std::fs::read(&header)succeeds andunwrap_err()panics before migration is exercised. The extracted test reproducibly fails as root and passes as an unprivileged user. Run the permission-specific case without elevated access, skip it when access cannot be denied, or use deterministic read-failure injection.Useful? React with 👍 / 👎.
Imported from fxceless/victory-fork. Originally posted by JordanFableFur on 2026-11-25T01:46:22Z.
Closing — #322 fixes the same issue (#242) and was opened first. One thing I did not see covered there and worth carrying into review: while a legacy directory is stuck (its migration failing whole on an unreadable blob), an update to the container can still commit a fresh version holding only the submitted blobs, and the next scan then clears the old directory as done — the readable legacy blobs are lost. Refusing updates to that container until the migration goes through closes it.
Pull request closed