hle(xgamesave): propagate legacy blob read errors instead of dropping blobs during migration #338
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/338"
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 Caasares on 2026-11-24T23:36:24Z.
Fixes #242
Root cause
migrateincrates/victory-hle/src/modules/xgamesave.rsiterated over the legacy save folder using.read_dir(old).ok()?.flatten().filter_map(...), convertingstd::fs::read(e.path()).ok()?intoNoneinside thefilter_mapclosure. Anyread_direntry error orfs::readfailure on a recognized blob name was silently dropped instead of aborting migration, causingcommitto writev1without the unreadable blob andremove_dir_all(old)to delete the rest of the legacy directory.Fix
migratewith an explicitfor entry in std::fs::read_dir(old).ok()?loop that propagates directory-entry errors andstd::fs::read(entry.path())errors for recognized blob names via.ok()?beforecommit, leaving the legacy directory intact so a subsequent call can retry.continuewhenfile.to_str().and_then(decode)isNone) and optional.displaymetadata handling (unwrap_or_default()).crates/victory-hle/src/modules/xgamesave.rs:unreadable_legacy_blob_leaves_old_layout_for_retry(#[cfg(windows)], lockingHeaderviaOpenOptionsExt::share_mode(0))unreadable_legacy_blob_entry_blocks_migration_without_display(unreadableHeaderdirectory entry without.display)Verification
Ran inside
wt-vf-242on Windows:cargo clippy --workspace --all-targets --locked -- -D warnings— passedcargo clippy --workspace --all-targets --all-features --locked -- -D warnings— passedcargo test --workspace --locked— passed (498passed,0failed,7ignored across all workspace crates, includingvictory-hle97unit tests +1integration test andxtaskpolicy checks)2119b0ebefore the fix and pass after the fix.rustfmt --edition 2024 --check(rustfmt.toml).AI-assisted change; contains no game files, keys, or assets.
Imported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T00:23:19Z.
Duplicate of #322?
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.