XGameSave: an unreadable legacy blob keeps the old layout #383
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!383
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/383/head"
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?
@JordanFableFur on GitHub · 2026-11-25 00:12 UTC · original
JordanFableFur:fix/gamesave-migrate-keeps-old-on-error→main· +82 −9 · 1 files · 2 commits · closed without mergingWhat
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.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:13 UTC · original · edited 2026-11-25 00:16 UTC
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.
@kaayzouee on GitHub · 2026-11-25 00:24 UTC · original
Duplicate of #322?
@JordanFableFur on GitHub · 2026-11-25 00:33 UTC · original
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.@JordanFableFur on GitHub · 2026-11-25 01:46 UTC · original
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.
@ -313,0 +316,4 @@let Some(blob) = entry.file_name().to_str().and_then(decode) else {continue;};let data = std::fs::read(entry.path()).ok()?;@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:16 UTC · original
When 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 👍 / 👎.
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:16 UTC · original
On
crates/victory-hle/src/modules/xgamesave.rsline 1172 (outdated):When 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 👍 / 👎.
Pull request closed