hle(xgamesave): propagate legacy blob read errors instead of dropping blobs during migration #338
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!338
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@Caasares on GitHub · 2026-11-24 23:36 UTC · original
Caasares:fix/xgamesave-migration-read-errors→main· +96 −8 · 1 files · 1 commits · openFixes #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.
@kaayzouee on GitHub · 2026-11-25 00:23 UTC · original
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.