XGameSave: a legacy blob that cannot be read stops the migration instead of being dropped #322

Open
github-bot wants to merge 1 commit from github-bot/gh-322 into main AGit
Owner

@⁠RenzoWit35 on GitHub · 2026-11-24 23:34 UTC · original
RenzoWit35:fix/242-save-migration-keeps-unreadable-blobs → main · +34 −9 · 1 files · 1 commits · open

Fixes #242.

migrate() collected old-layout blobs through .flatten().filter_map(... read(..).ok()?), so a
directory entry or blob that failed to read was skipped, v1 was committed without it, and the
old folder was removed: the blob was lost. It is now a loop that returns before committing on a
directory-entry error or a failed read of a name that decodes as a blob. The old container stays
in place, and the next open tries again. Names that are not blobs (.display, *.new) are still
skipped, and display metadata is unchanged.

Test an_unreadable_old_blob_is_not_dropped: an old container with Data and a folder named
Header (unreadable as a file) is left whole with nothing committed; once Header is a
readable file, the next open migrates both. Fails on main (old folder deleted), passes here.

Note for review: a blob that stays unreadable means its container stays unlisted on every open,
with no warning logged.

Testing

On Windows 11, MSVC Rust 1.98.1, branch alone on top of main (2119b0e): cargo clippy --workspace --all-targets --locked -- -D warnings, the same with --all-features, and cargo test --workspace --locked all pass. The new regression test fails on main and passes here. All nine fix branches for #242-#250 also pass together when merged.

🤖 Generated with Claude Code

**@⁠RenzoWit35** on GitHub · 2026-11-24 23:34 UTC · [original](https://github.com/fxceless/victory-fork/pull/322) `RenzoWit35:fix/242-save-migration-keeps-unreadable-blobs` → `main` · +34 −9 · 1 files · 1 commits · open Fixes #242. `migrate()` collected old-layout blobs through `.flatten().filter_map(... read(..).ok()?)`, so a directory entry or blob that failed to read was skipped, v1 was committed without it, and the old folder was removed: the blob was lost. It is now a loop that returns before committing on a directory-entry error or a failed read of a name that decodes as a blob. The old container stays in place, and the next open tries again. Names that are not blobs (`.display`, `*.new`) are still skipped, and display metadata is unchanged. Test `an_unreadable_old_blob_is_not_dropped`: an old container with `Data` and a folder named `Header` (unreadable as a file) is left whole with nothing committed; once `Header` is a readable file, the next open migrates both. Fails on `main` (old folder deleted), passes here. Note for review: a blob that stays unreadable means its container stays unlisted on every open, with no warning logged. ## Testing On Windows 11, MSVC Rust 1.98.1, branch alone on top of `main` (2119b0e): `cargo clippy --workspace --all-targets --locked -- -D warnings`, the same with `--all-features`, and `cargo test --workspace --locked` all pass. The new regression test fails on `main` and passes here. All nine fix branches for #242-#250 also pass together when merged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Moving a container of the old one-file-per-blob layout skipped every
directory entry or blob it could not read, then committed what was left
and removed the old folder, so an unreadable blob was lost for good. Entry
errors and read errors of files with a blob's name now stop the move before
anything is committed; the old folder stays, and a later open tries again.
Files that are not blobs are still skipped, the display name as before.

The test makes one blob of an old container a folder by that name: nothing
is committed and both files stay; once it is a readable file again, the
next open moves both blobs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:40:41 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/322/head:github-bot/gh-322'
git switch 'github-bot/gh-322'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-322'
git switch 'github-bot/gh-322'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-322'
git switch 'github-bot/gh-322'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-322'
git switch 'main'
git merge --squash 'github-bot/gh-322'
git switch 'main'
git merge --ff-only 'github-bot/gh-322'
git switch 'main'
git merge 'github-bot/gh-322'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.