XGameSave: defer container deletion until work dispatch #108

Manually merged
github merged 1 commit from gh-pr/108/head into gh-pr/108/base 2026-11-26 04:10:23 +00:00
Owner

@⁠certified-retart on GitHub · 2026-11-23 11:17 UTC · original
certified-retart:fix/gamesave-defer-delete → main · +172 −8 · 1 files · 1 commits · merged 2026-11-23 11:32 UTC

A title using a manual work port could submit a container delete, see the operation still pending, and find its save already gone. A terminated queue could report E_ABORT after the same deletion.

Resolve the container path while the caller's inputs are valid, and delete it in the queued work callback. Serialize deletion with blob updates and report the status through XGameSaveDeleteContainerResult. Both delete entry points now apply the same name length checks as container creation.

Three synthetic tests cover manual dispatch with released inputs, queue termination before work runs or before submission, and invalid arguments preserving existing saves. On Windows, 432 library tests and 2 launcher integration tests passed with a single test thread. The library suite reported 16 ignored.

**@⁠certified-retart** on GitHub · 2026-11-23 11:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/108) `certified-retart:fix/gamesave-defer-delete` → `main` · +172 −8 · 1 files · 1 commits · merged 2026-11-23 11:32 UTC A title using a manual work port could submit a container delete, see the operation still pending, and find its save already gone. A terminated queue could report E_ABORT after the same deletion. Resolve the container path while the caller's inputs are valid, and delete it in the queued work callback. Serialize deletion with blob updates and report the status through XGameSaveDeleteContainerResult. Both delete entry points now apply the same name length checks as container creation. Three synthetic tests cover manual dispatch with released inputs, queue termination before work runs or before submission, and invalid arguments preserving existing saves. On Windows, 432 library tests and 2 launcher integration tests passed with a single test thread. The library suite reported 16 ignored.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:10:22 +00:00
github manually merged commit b3dd82d7da into gh-pr/108/base 2026-11-26 04:10:23 +00:00
Author
Owner

@⁠raylitebull on GitHub · 2026-11-23 11:22 UTC · original

Nice fix — deferring async container deletion until work dispatch and serializing it with apply() is much cleaner and strictly supersedes #95 (which only added the empty/overlong name guard). I've closed #95 in favor of this PR.

Note: #97 touches the complementary parts of gamesave.rs (atomic ~xcltmp + MoveFileExW writes inside apply(), NTFS case-insensitive lookups, and null out validation in XGameSaveInitializeProviderResult) — happy to rebase #97 cleanly on top once this lands.

**@⁠raylitebull** on GitHub · 2026-11-23 11:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/108#issuecomment-7099530467) Nice fix — deferring async container deletion until work dispatch and serializing it with `apply()` is much cleaner and strictly supersedes #95 (which only added the empty/overlong name guard). I've closed #95 in favor of this PR. Note: #97 touches the complementary parts of `gamesave.rs` (atomic `~xcltmp` + `MoveFileExW` writes inside `apply()`, NTFS case-insensitive lookups, and null `out` validation in `XGameSaveInitializeProviderResult`) — happy to rebase #97 cleanly on top once this lands.
Author
Owner

@⁠certified-retart on GitHub · 2026-11-23 11:24 UTC · original

Thanks for the name-validation fix in #95 and for coordinating the overlap. I checked the current heads locally: #97 at 2d94699 and #108 at b3dd82d merge cleanly with git merge-tree. The mutation lock in #108 covers apply(), including the atomic write path proposed in #97.

**@⁠certified-retart** on GitHub · 2026-11-23 11:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/108#issuecomment-7099589526) Thanks for the name-validation fix in #95 and for coordinating the overlap. I checked the current heads locally: #97 at 2d94699 and #108 at b3dd82d merge cleanly with git merge-tree. The mutation lock in #108 covers apply(), including the atomic write path proposed in #97.
Author
Owner

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

Merged. It conflicted with #95's identical name check, which had landed on main with #96–#102 before #95 was closed; resolved in favour of your deferred form (delete_path + delete_container under SAVE_MUTATION). Checked on Windows 11 with an RX 9070: cargo test --workspace green with the retail samples (shader pack, console DLLs, texture archive), lib tests also with XCL_SPLIT_WAVE64=1; Unicorn Overlord runs with #107–#109 merged. Thanks!

**@⁠ivall** on GitHub · 2026-11-23 11:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/108#issuecomment-7099783679) Merged. It conflicted with #95's identical name check, which had landed on `main` with #96–#102 before #95 was closed; resolved in favour of your deferred form (`delete_path` + `delete_container` under `SAVE_MUTATION`). Checked on Windows 11 with an RX 9070: `cargo test --workspace` green with the retail samples (shader pack, console DLLs, texture archive), lib tests also with `XCL_SPLIT_WAVE64=1`; Unicorn Overlord runs with #107–#109 merged. Thanks!
This discussion has been locked. Commenting is limited to contributors.
No description provided.