[PR #7328] [MERGED] Launcher: report settings save failures and offer retry #7497

Closed
opened 2026-11-03 06:40:10 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7328
Author: @masa-masa-0314
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/launcher-settings-save-errors


📝 Commits (2)

  • 344445e Launcher: report settings save failures and offer retry
  • 64faa04 Merge main into #7328

📊 Changes

26 files changed (+186 additions, -71 deletions)

View changed files

📝 launcher/lang/de.json (+3 -0)
📝 launcher/lang/es.json (+3 -0)
📝 launcher/lang/fr.json (+3 -0)
📝 launcher/lang/ja.json (+3 -0)
📝 launcher/lang/pl.json (+3 -0)
📝 launcher/lang/pt-br.json (+3 -0)
📝 launcher/lang/ru.json (+3 -0)
📝 launcher/lang/tr.json (+3 -0)
📝 launcher/lang/uk.json (+3 -0)
📝 launcher/lang/zh.json (+3 -0)
📝 launcher/src/backend.rs (+11 -5)
📝 launcher/src/build_import.rs (+1 -1)
📝 launcher/src/cli.rs (+20 -19)
📝 launcher/src/collection.rs (+1 -1)
📝 launcher/src/dev_options.rs (+1 -1)
📝 launcher/src/github_mods_page.rs (+1 -1)
📝 launcher/src/home.rs (+1 -1)
📝 launcher/src/instances.rs (+14 -5)
📝 launcher/src/instances_page.rs (+7 -4)
📝 launcher/src/language_page.rs (+1 -1)

...and 6 more files

📄 Description

🤖 Opened by masa-masa-0314's AI agent (ZCode, GPT-6), not by masa-masa-0314 personally.

What and why

Fixes #7274.

When writing settings.json failed (for example, a full disk or a file that cannot be replaced), Settings::save printed to stderr and returned no result. GUI changes appeared saved and CLI/MCP still reported success. An installation could also prune versions before its selected version was safely persisted.

  • Return errors from Settings::save, retaining temporary-file replacement and cleanup. Serialize same-process saves so the window and background jobs cannot write the same PID-named temporary file concurrently.
  • Propagate failures through CLI and shared backend callers; emit successful CLI output only after the required setting write succeeds. MCP inherits the CLI error.
  • Route GUI saves through one helper and show a persistent, non-modal notice with Retry. Current-session choices remain available; a successful save clears the notice. Skip post-install pruning after selection-save failure.
  • Distinguish an instance that was successfully deleted from a later selection-save failure, so the GUI refreshes and offers save recovery rather than presenting the deleted instance as still deletable.
  • Translate the two notice strings and Retry in the ten supported non-English tables, as required by the existing completeness test.

The 26-file scope is mostly the existing save callers and three translation keys; total +186/-71. This does not implement the data-directory relocation requested in #7218.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only launcher persistence and error reporting; no vanilla gameplay behavior changes.

Other projects' code

None.

Self-check

On final source at baseline c608c23e1fb609d1d43a45819c9cd98ec1992682 plus this patch:

  • cargo check --manifest-path launcher/Cargo.toml --locked --all-targets: exit 0.
  • Final launcher build: exit 0. Builds/checks used CARGO_PROFILE_DEV_DEBUG=0, CARGO_PROFILE_TEST_DEBUG=0 where applicable, and CARGO_INCREMENTAL=0 to limit disk use.
  • Actual CLI processes under isolated homes: an invalid data directory produces exit 1 and no success output; a Windows file handle allowing reads but denying replacement makes settings/game-args/desktop-entry all fail, preserve the old bytes and clean temporary files. Releasing the lock allows a successful retry and persisted value.
  • Actual MCP stdio server: settings tool returns isError: true with the settings path on save failure.
  • Temporary probe linked to the actual launcher library: an obstructed temporary path preserves old settings; retry succeeds; 16 threads perform 160 saves successfully and leave one complete writer's JSON with no temporary file remaining.
  • Temporary validation scripts/logs are archived locally, not included in the PR per contributor preference. No new permanent regression tests are added; existing tests, including translation completeness, remain intact.

The committed files were verified against the tested source snapshot. Original project self-check block follows unchanged:

pr_ready (tools/pr_ready.py --quick --base c608c23e1 on DESKTOP-3050AHP, against c608c23e1 at c608c23e1, 3 min 44 s)

Check Result
Scope ✅ 26 files, +186 −71
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (2 min 58 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
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 ✅ (12 s)
launcher tests ✅ 437 passed (29 s)
Parity ➖ not run (--quick): 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)

The root-workspace Rust rows are skipped because the launcher is a separate workspace; launcher checks above ran. Full gameplay parity was intentionally not run (--quick).

Screenshots

Not captured. The GUI notice/Retry has compiled and existing tests pass, but interactive visual verification and GUI click-through were not performed. Failure/retry persistence, CLI and MCP behavior were tested as described above.

🤖 Generated with ZCode (GPT-6).


🔄 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/7328 **Author:** [@masa-masa-0314](https://github.com/masa-masa-0314) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/launcher-settings-save-errors` --- ### 📝 Commits (2) - [`344445e`](https://github.com/horizon-rust/horizon/commit/344445ef2cdce1e98b1705635e39c34014207dd5) Launcher: report settings save failures and offer retry - [`64faa04`](https://github.com/horizon-rust/horizon/commit/64faa0482a86635a37775b7755a04ac4ef47a69e) Merge main into #7328 ### 📊 Changes **26 files changed** (+186 additions, -71 deletions) <details> <summary>View changed files</summary> 📝 `launcher/lang/de.json` (+3 -0) 📝 `launcher/lang/es.json` (+3 -0) 📝 `launcher/lang/fr.json` (+3 -0) 📝 `launcher/lang/ja.json` (+3 -0) 📝 `launcher/lang/pl.json` (+3 -0) 📝 `launcher/lang/pt-br.json` (+3 -0) 📝 `launcher/lang/ru.json` (+3 -0) 📝 `launcher/lang/tr.json` (+3 -0) 📝 `launcher/lang/uk.json` (+3 -0) 📝 `launcher/lang/zh.json` (+3 -0) 📝 `launcher/src/backend.rs` (+11 -5) 📝 `launcher/src/build_import.rs` (+1 -1) 📝 `launcher/src/cli.rs` (+20 -19) 📝 `launcher/src/collection.rs` (+1 -1) 📝 `launcher/src/dev_options.rs` (+1 -1) 📝 `launcher/src/github_mods_page.rs` (+1 -1) 📝 `launcher/src/home.rs` (+1 -1) 📝 `launcher/src/instances.rs` (+14 -5) 📝 `launcher/src/instances_page.rs` (+7 -4) 📝 `launcher/src/language_page.rs` (+1 -1) _...and 6 more files_ </details> ### 📄 Description > 🤖 Opened by masa-masa-0314's AI agent (ZCode, GPT-6), not by masa-masa-0314 personally. ## What and why Fixes #7274. When writing settings.json failed (for example, a full disk or a file that cannot be replaced), Settings::save printed to stderr and returned no result. GUI changes appeared saved and CLI/MCP still reported success. An installation could also prune versions before its selected version was safely persisted. - Return errors from Settings::save, retaining temporary-file replacement and cleanup. Serialize same-process saves so the window and background jobs cannot write the same PID-named temporary file concurrently. - Propagate failures through CLI and shared backend callers; emit successful CLI output only after the required setting write succeeds. MCP inherits the CLI error. - Route GUI saves through one helper and show a persistent, non-modal notice with Retry. Current-session choices remain available; a successful save clears the notice. Skip post-install pruning after selection-save failure. - Distinguish an instance that was successfully deleted from a later selection-save failure, so the GUI refreshes and offers save recovery rather than presenting the deleted instance as still deletable. - Translate the two notice strings and Retry in the ten supported non-English tables, as required by the existing completeness test. The 26-file scope is mostly the existing save callers and three translation keys; total +186/-71. This does not implement the data-directory relocation requested in #7218. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only launcher persistence and error reporting; no vanilla gameplay behavior changes. ## Other projects' code None. ## Self-check On final source at baseline `c608c23e1fb609d1d43a45819c9cd98ec1992682` plus this patch: - `cargo check --manifest-path launcher/Cargo.toml --locked --all-targets`: exit 0. - Final launcher build: exit 0. Builds/checks used `CARGO_PROFILE_DEV_DEBUG=0`, `CARGO_PROFILE_TEST_DEBUG=0` where applicable, and `CARGO_INCREMENTAL=0` to limit disk use. - Actual CLI processes under isolated homes: an invalid data directory produces exit 1 and no success output; a Windows file handle allowing reads but denying replacement makes settings/game-args/desktop-entry all fail, preserve the old bytes and clean temporary files. Releasing the lock allows a successful retry and persisted value. - Actual MCP stdio server: settings tool returns `isError: true` with the settings path on save failure. - Temporary probe linked to the actual launcher library: an obstructed temporary path preserves old settings; retry succeeds; 16 threads perform 160 saves successfully and leave one complete writer's JSON with no temporary file remaining. - Temporary validation scripts/logs are archived locally, not included in the PR per contributor preference. No new permanent regression tests are added; existing tests, including translation completeness, remain intact. The committed files were verified against the tested source snapshot. Original project self-check block follows unchanged: **pr_ready** (`tools/pr_ready.py --quick --base c608c23e1` on DESKTOP-3050AHP, against c608c23e1 at c608c23e1, 3 min 44 s) | Check | Result | | --- | --- | | Scope | ✅ 26 files, +186 −71 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (2 min 58 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | 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 | ✅ (12 s) | | launcher tests | ✅ 437 passed (29 s) | | Parity | ➖ not run (--quick): 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) | The root-workspace Rust rows are skipped because the launcher is a separate workspace; launcher checks above ran. Full gameplay parity was intentionally not run (`--quick`). ## Screenshots Not captured. The GUI notice/Retry has compiled and existing tests pass, but interactive visual verification and GUI click-through were not performed. Failure/retry persistence, CLI and MCP behavior were tested as described above. 🤖 Generated with ZCode (GPT-6). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:40:10 +07:00
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#7497
No description provided.