Skip to content

VFS: preserve external destination when overlay move fails - #171

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
mstr-vinegar:fix-overlay-external-move
Nov 23, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
mstr-vinegar:fix-overlay-external-move

Conversation

@mstr-vinegar

Copy link
Copy Markdown
Contributor

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.

@ivall
ivall merged commit 0fb0fd8 into xcl-dev:main Nov 23, 2026
@ivall

ivall commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants