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

Open
RenzoWit35 wants to merge 1 commit from upstream-pr/322 into main
RenzoWit35 commented 2026-11-24 23:34:31 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by RenzoWit35 on 2026-11-24T23:34:31Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593594294 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/322). Originally posted by [RenzoWit35](https://github.com/RenzoWit35) on 2026-11-24T23:34:31Z. --- 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)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/322:upstream-pr/322'
git switch 'upstream-pr/322'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/322'
git switch 'upstream-pr/322'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/322'
git switch 'upstream-pr/322'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/322'
git switch 'main'
git merge --squash 'upstream-pr/322'
git switch 'main'
git merge --ff-only 'upstream-pr/322'
git switch 'main'
git merge 'upstream-pr/322'
git push origin 'main'
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
fxceless/victory-fork!322
No description provided.