[PR #2969] [MERGED] Ask for a backup before upgrading a world that needs file fixes #4723

Closed
opened 2026-11-03 05:07:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2969
Author: @kacpherek
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix/backup-before-world-upgrade


📝 Commits (1)

  • 8fdcb37 Ask for a backup before upgrading a world that needs file fixes

📊 Changes

5 files changed (+127 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+8 -0)
📝 crates/horizon-client/src/game/agent.rs (+3 -0)
📝 crates/horizon-client/src/save.rs (+13 -0)
📝 crates/horizon-client/src/title.rs (+102 -8)
📝 crates/horizon-client/src/title/tests.rs (+1 -0)

📄 Description

What and why

  • Opening a world last saved before DataVersion 4899 now asks first, as vanilla does: "Create a backup before upgrading this world?" with "Create Backup and Load", "I Know What I'm Doing!" and Cancel. Before, Horizon upgraded such a world in place with no prompt.
  • "Create Backup and Load" uses the existing Make Backup code, then opens the world. It opens even when the backup failed, and a failure toast shows, as EditWorldScreen does.
  • Cancel and Escape return to the world list. Worlds at DataVersion 4899 or newer open as before, with no prompt.
  • The title test fixture world now carries the current DataVersion. Two tests in title/tests.rs assumed a world without one opens at once.

Vanilla reference

  • WorldOpenFlows.java:365-380 (backupStatus.shouldBackup: BackupConfirmScreen, else upgradeAndOpenWorld)
  • LevelSummary.java:120-131 (backupStatus: file fixing first; the snapshot case needs a non-stable build, and 26.3 is stable)
  • LevelSummary.java:213-218 (FILE_FIXING_REQUIRED asks for a backup)
  • FileFixerUpper.java:67-73 (requiresFileFixing); DataFixers.java:1695 (newest file fix, 4899)
  • BackupConfirmScreen.java (five-argument constructor, so no "erase cache" box on this path)
  • EditWorldScreen.java:179-205 (the backup, then the callback, also when it fails)

Self-check

clippy and fmt pass for horizon-client. Not run in game.


🔄 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/2969 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/backup-before-world-upgrade` --- ### 📝 Commits (1) - [`8fdcb37`](https://github.com/horizon-rust/horizon/commit/8fdcb37ddd25a967a5e253b15e8a8f3f568c93bb) Ask for a backup before upgrading a world that needs file fixes ### 📊 Changes **5 files changed** (+127 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+8 -0) 📝 `crates/horizon-client/src/game/agent.rs` (+3 -0) 📝 `crates/horizon-client/src/save.rs` (+13 -0) 📝 `crates/horizon-client/src/title.rs` (+102 -8) 📝 `crates/horizon-client/src/title/tests.rs` (+1 -0) </details> ### 📄 Description ## What and why - Opening a world last saved before DataVersion 4899 now asks first, as vanilla does: "Create a backup before upgrading this world?" with "Create Backup and Load", "I Know What I'm Doing!" and Cancel. Before, Horizon upgraded such a world in place with no prompt. - "Create Backup and Load" uses the existing Make Backup code, then opens the world. It opens even when the backup failed, and a failure toast shows, as EditWorldScreen does. - Cancel and Escape return to the world list. Worlds at DataVersion 4899 or newer open as before, with no prompt. - The title test fixture world now carries the current DataVersion. Two tests in title/tests.rs assumed a world without one opens at once. ## Vanilla reference - WorldOpenFlows.java:365-380 (backupStatus.shouldBackup: BackupConfirmScreen, else upgradeAndOpenWorld) - LevelSummary.java:120-131 (backupStatus: file fixing first; the snapshot case needs a non-stable build, and 26.3 is stable) - LevelSummary.java:213-218 (FILE_FIXING_REQUIRED asks for a backup) - FileFixerUpper.java:67-73 (requiresFileFixing); DataFixers.java:1695 (newest file fix, 4899) - BackupConfirmScreen.java (five-argument constructor, so no "erase cache" box on this path) - EditWorldScreen.java:179-205 (the backup, then the callback, also when it fails) ## Self-check clippy and fmt pass for horizon-client. Not run in game. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:28 +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#4723
No description provided.