XGameSave: defer container deletion until work dispatch #107

Merged
certified-retart merged 1 commit from upstream-pr/108 into main 2026-11-23 11:32:41 +00:00
certified-retart commented 2026-11-23 11:17:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by certified-retart on 2026-11-23T11:17:55Z.


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.

<!-- greyfinch-sync:ivall/xcl:issue:6558077039 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/108). Originally posted by [certified-retart](https://github.com/certified-retart) on 2026-11-23T11:17:55Z. --- 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.
upstream-sync closed this pull request 2026-11-24 06:57:11 +00:00
raylitebull commented 2026-11-24 07:00:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-23T11:22:08Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7099530467 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/108#issuecomment-7099530467). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-23T11:22:08Z. --- 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.
certified-retart commented 2026-11-24 07:00:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by certified-retart on 2026-11-23T11:24:12Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7099589526 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/108#issuecomment-7099589526). Originally posted by [certified-retart](https://github.com/certified-retart) on 2026-11-23T11:24:12Z. --- 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.
ivall commented 2026-11-24 07:00:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T11:32:52Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7099783679 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/108#issuecomment-7099783679). Originally posted by [ivall](https://github.com/ivall) on 2026-11-23T11:32:52Z. --- 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!
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
xcl-dev/xcl!107
No description provided.