VFS: preserve external destination when overlay move fails #171

Manually merged
github merged 1 commit from gh-pr/171/head into gh-pr/171/base 2026-11-26 04:13:35 +00:00
Owner

@⁠mstr-vinegar on GitHub · 2026-11-23 18:45 UTC · original
mstr-vinegar:fix-overlay-external-move → main · +45 −0 · 1 files · 1 commits · merged 2026-11-23 20:51 UTC

Problem

Moving an overlay file to a same-volume non-game path can overwrite the destination even when the move fails: copying succeeds, then deleting a source opened without delete sharing fails.

Use a native same-volume rename for this case so Windows checks sharing before replacing the destination. Preserve the existing fallback for cross-volume moves. This complements #160, which handles moves between game paths.

Verification

  • On base 956a476, the new regression failed because the destination contained the source bytes after the failed move.
  • On this branch, cargo test --locked -p xcl vfs -- --test-threads=4: 16 passed, 0 failed (Windows 11, Rust 1.100.0 MSVC).
  • The test checks the locked-source failure, retry after closing the handle, preservation of the original game file, and an overlay-only source.

Cross-volume and delayed moves retain their existing behavior and are not covered by this fix. AI-assisted implementation and testing.

**@⁠mstr-vinegar** on GitHub · 2026-11-23 18:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/171) `mstr-vinegar:fix-overlay-external-move` → `main` · +45 −0 · 1 files · 1 commits · merged 2026-11-23 20:51 UTC ## Problem Moving an overlay file to a same-volume non-game path can overwrite the destination even when the move fails: copying succeeds, then deleting a source opened without delete sharing fails. Use a native same-volume rename for this case so Windows checks sharing before replacing the destination. Preserve the existing fallback for cross-volume moves. This complements #160, which handles moves between game paths. ## Verification - On base `956a476`, the new regression failed because the destination contained the source bytes after the failed move. - On this branch, `cargo test --locked -p xcl vfs -- --test-threads=4`: 16 passed, 0 failed (Windows 11, Rust 1.100.0 MSVC). - The test checks the locked-source failure, retry after closing the handle, preservation of the original game file, and an overlay-only source. Cross-volume and delayed moves retain their existing behavior and are not covered by this fix. AI-assisted implementation and testing.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:34 +00:00
github manually merged commit 10b50eac9b into gh-pr/171/base 2026-11-26 04:13:35 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-23 20:52 UTC · original

Merged (main 2abc562), together with #160 - not a duplicate of it: #160 covers a destination inside the game folder, this one a destination outside it. The conflict was resolved by keeping both paths; the external one now calls #160's commit_overlay_removal(sr) instead of delete_file(sr) (same effect: the original stays hidden and the move is recorded). Both tests are kept and pass. Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main 38b05b7: cargo build --workspace && cargo test --workspace -- --test-threads=4 - 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.

**@⁠ivall** on GitHub · 2026-11-23 20:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/171#issuecomment-7113681854) Merged (main 2abc562), together with #160 - not a duplicate of it: #160 covers a destination inside the game folder, this one a destination outside it. The conflict was resolved by keeping both paths; the external one now calls #160's `commit_overlay_removal(sr)` instead of `delete_file(sr)` (same effect: the original stays hidden and the move is recorded). Both tests are kept and pass. Checked on an RX 9070 (RDNA4) with the 11 PRs merged together on main 38b05b7: `cargo build --workspace && cargo test --workspace -- --test-threads=4` - 547 unit tests passed, 0 failed (19 ignored); the integration and e2e tests passed too.
This discussion has been locked. Commenting is limited to contributors.
No description provided.