HLE: preserve legacy saves when migration cannot finish #341

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

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


Fixes #242.

Read every recognized legacy blob before publishing the converted version. Propagate directory-entry and blob read errors so migration can retry with the original data. Optional display metadata and unrelated filenames keep their existing handling.

Scan the provider before taking an update's current-version snapshot. A failed migration for that container or an incomplete provider listing blocks creation of a new first version. When access is restored, migration runs first and the update keeps any legacy blobs it does not replace.

Verification

  • On 2119b0e, real filesystem tests reproduced an unreadable Header being dropped and the legacy directory being removed. A read-loop-only patch still let an update publish a first version while migration was blocked.
  • Five source-built filesystem checks passed on the final patch. They include a provider directory that permits writes but denies listing, an unreadable blob, an alternate encoded container name, and a successful update after access is restored.
  • Windows MSVC-target tests type-checked for victory-loader and victory-hle with pure BLAKE3. Native Windows execution and concurrent independent processes sharing a provider directory were outside this run.
<!-- greyfinch-sync:fxceless/victory-fork:issue:6593650793 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/341). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-24T23:38:31Z. --- Fixes #242. Read every recognized legacy blob before publishing the converted version. Propagate directory-entry and blob read errors so migration can retry with the original data. Optional display metadata and unrelated filenames keep their existing handling. Scan the provider before taking an update's current-version snapshot. A failed migration for that container or an incomplete provider listing blocks creation of a new first version. When access is restored, migration runs first and the update keeps any legacy blobs it does not replace. ## Verification - On `2119b0e`, real filesystem tests reproduced an unreadable `Header` being dropped and the legacy directory being removed. A read-loop-only patch still let an update publish a first version while migration was blocked. - Five source-built filesystem checks passed on the final patch. They include a provider directory that permits writes but denies listing, an unreadable blob, an alternate encoded container name, and a successful update after access is restored. - Windows MSVC-target tests type-checked for `victory-loader` and `victory-hle` with pure BLAKE3. Native Windows execution and concurrent independent processes sharing a provider directory were outside this run.
avt0m4t48 commented 2026-11-25 15:08:33 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T14:43:19Z.


Native Windows verification on b4700bf8: all nine XGameSave module tests passed. An additional test opened a legacy header exclusively and confirmed that the normal read hit Windows error 32 (sharing violation). The baseline published a partial migrated save. The patched branch kept the original, returned NO_ACCESS when an update tried to publish, and preserved the locked header alongside the new data on a retry after the handle closed.

The new fixture uses a temporary provider with authored data. Concurrent providers in separate processes remain unverified.

Native Windows run with the baseline and patch

AI-assisted using Codex.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7165712037 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/341#issuecomment-7165712037). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T14:43:19Z. --- Native Windows verification on `b4700bf8`: all nine XGameSave module tests passed. An additional test opened a legacy header exclusively and confirmed that the normal read hit Windows error 32 (sharing violation). The baseline published a partial migrated save. The patched branch kept the original, returned `NO_ACCESS` when an update tried to publish, and preserved the locked header alongside the new data on a retry after the handle closed. The new fixture uses a temporary provider with authored data. Concurrent providers in separate processes remain unverified. [Native Windows run with the baseline and patch](https://github.com/avt0m4t48/victory-fork/actions/runs/45636256267) AI-assisted using Codex.
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/341:upstream-pr/341'
git switch 'upstream-pr/341'

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/341'
git switch 'upstream-pr/341'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/341'
git switch 'upstream-pr/341'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/341'
git switch 'main'
git merge --squash 'upstream-pr/341'
git switch 'main'
git merge --ff-only 'upstream-pr/341'
git switch 'main'
git merge 'upstream-pr/341'
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!341
No description provided.