[PR #7885] Fix world-operation locks and filesystem save/removal failures #7880

Open
opened 2026-11-03 07:25:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7885
Author: @jedev3095
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/filesystem-safety


📝 Commits (1)

  • b776cdd Fix world-operation locks and filesystem save/removal failures

📊 Changes

4 files changed (+90 additions, -3 deletions)

View changed files

📝 crates/horizon-world/src/region.rs (+5 -1)
📝 launcher/src/backend.rs (+40 -2)
📝 launcher/src/worlds.rs (+21 -0)
📝 launcher/src/worlds/tests.rs (+24 -0)

📄 Description

🤖 Opened by jedev3095's AI agent (Codex, GPT-6), not by jedev3095 personally.

What and why

Fixes #7882.

  • Acquire the world's session lock before launcher backup, copy, or trash operations. Backup/copy hold it throughout; trash follows the existing server-deletion handling on Windows, where an open lock handle prevents moving the folder.
  • Restore the installation marker when version deletion fails, so the surviving installation stays discoverable and removal can be retried. This preserves the existing behavior of hiding a version while removal is in progress. It does not roll back files already deleted.
  • Sync oversized chunks' external payload files before renaming them into place. Syncing the region file alone only covers the external-data stub.

Add regressions for active-world refusal and failed Windows removal/retry. Four production/test files, under 100 added lines.

Kind

  • bug: a crash or a breakage

Vanilla reference

No gameplay or file-format changes. The launcher uses the same filesystem lock API as Horizon's existing SessionLock; Windows trash handling follows launcher/src/servers.rs. External payload syncing follows the existing RegionWriter export path. No fresh vanilla bytecode inspection or vanilla parity claim.

Other projects' code

None. Only this repository's code was read or reused.

Self-check

The full local self-check passed. Final committed diff: 4 files, +90 / -3. The scope warning reflects the related launcher and region-file fixes in this PR.

Passed on Windows:

  • cargo test -p horizon-world --test world_io --locked: 8 passed, 1 ignored benchmark.
  • cargo test --manifest-path launcher/Cargo.toml --lib worlds::tests --locked: 4 passed, including the active-world regression.
  • cargo test --manifest-path launcher/Cargo.toml --lib failed_removal_stays_listed_and_can_be_retried --locked: 1 passed.
  • Isolated Windows probe using the original and fixed removal functions: original fails the marker-retention assertion; fixed passes. Both report the initial deletion failure and remove the directory after the blocking handle closes.
    pr_ready (tools/pr_ready.py on HenryPC, against origin/main at 31f83499b, 5 min 36 s)
Check Result
Scope ⚠️ 4 files, +90 −2; mixes game, launcher
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (1 min 59 s)
rustfmt ✅ (13 s)
clippy ✅ (1 min 32 s)
tests: horizon-world ✅ 411 passed (34 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (1 min 2 s)
launcher tests ✅ 439 passed (8 s)
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

No real player data was used. No power-loss simulation, GUI click-through, Linux/macOS runtime verification, or vanilla parity run is claimed. The Windows lock/move interaction was checked separately using scratch directories.

🤖 Generated with Codex.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7885 **Author:** [@jedev3095](https://github.com/jedev3095) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/filesystem-safety` --- ### 📝 Commits (1) - [`b776cdd`](https://github.com/horizon-rust/horizon/commit/b776cdd21e0149a92c1e1a0a4530296970023f95) Fix world-operation locks and filesystem save/removal failures ### 📊 Changes **4 files changed** (+90 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-world/src/region.rs` (+5 -1) 📝 `launcher/src/backend.rs` (+40 -2) 📝 `launcher/src/worlds.rs` (+21 -0) 📝 `launcher/src/worlds/tests.rs` (+24 -0) </details> ### 📄 Description > 🤖 Opened by jedev3095's AI agent (Codex, GPT-6), not by jedev3095 personally. ## What and why Fixes #7882. - Acquire the world's session lock before launcher backup, copy, or trash operations. Backup/copy hold it throughout; trash follows the existing server-deletion handling on Windows, where an open lock handle prevents moving the folder. - Restore the installation marker when version deletion fails, so the surviving installation stays discoverable and removal can be retried. This preserves the existing behavior of hiding a version while removal is in progress. It does not roll back files already deleted. - Sync oversized chunks' external payload files before renaming them into place. Syncing the region file alone only covers the external-data stub. Add regressions for active-world refusal and failed Windows removal/retry. Four production/test files, under 100 added lines. ## Kind - [x] bug: a crash or a breakage ## Vanilla reference No gameplay or file-format changes. The launcher uses the same filesystem lock API as Horizon's existing `SessionLock`; Windows trash handling follows `launcher/src/servers.rs`. External payload syncing follows the existing `RegionWriter` export path. No fresh vanilla bytecode inspection or vanilla parity claim. ## Other projects' code None. Only this repository's code was read or reused. ## Self-check The full local self-check passed. Final committed diff: 4 files, +90 / -3. The scope warning reflects the related launcher and region-file fixes in this PR. Passed on Windows: - `cargo test -p horizon-world --test world_io --locked`: 8 passed, 1 ignored benchmark. - `cargo test --manifest-path launcher/Cargo.toml --lib worlds::tests --locked`: 4 passed, including the active-world regression. - `cargo test --manifest-path launcher/Cargo.toml --lib failed_removal_stays_listed_and_can_be_retried --locked`: 1 passed. - Isolated Windows probe using the original and fixed removal functions: original fails the marker-retention assertion; fixed passes. Both report the initial deletion failure and remove the directory after the blocking handle closes. **pr_ready** (`tools/pr_ready.py` on HenryPC, against origin/main at 31f83499b, 5 min 36 s) | Check | Result | | --- | --- | | Scope | ⚠️ 4 files, +90 −2; mixes game, launcher | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (1 min 59 s) | | rustfmt | ✅ (13 s) | | clippy | ✅ (1 min 32 s) | | tests: horizon-world | ✅ 411 passed (34 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (1 min 2 s) | | launcher tests | ✅ 439 passed (8 s) | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | No real player data was used. No power-loss simulation, GUI click-through, Linux/macOS runtime verification, or vanilla parity run is claimed. The Windows lock/move interaction was checked separately using scratch directories. 🤖 Generated with [Codex](https://openai.com/codex/). <!-- a fine addition to my collection --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7880
No description provided.