[PR #6857] [MERGED] Port map: an unreadable player file is backed up before the save overwrites it #7149

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

📋 Pull Request Information

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

Base: main ← Head: fix/ledger-game2023-playerbackup


📝 Commits (1)

  • 80f5297 port map: an unreadable player file is backed up before the save overwrites it

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 tools/port_map/game2-023.tsv (+1 -1)

📄 Description

PlayerDataStorage.backup copies a player file that fails to read to <uuid>_corrupted_<time>.dat beside it before the save writes over it, so a damaged player file is kept instead of being lost.

tools/port_map/game2-023.tsv said it was missing: "a player file that fails to load is not copied to a corrupted backup first; Horizon leaves it in place."

It is ported: save::back_up_unreadable_player (crates/horizon-client/src/save.rs:3065, its doc naming the vanilla method) copies the file when it does not read, and the player save calls it before writing (crates/horizon-client/src/save.rs:4219).

Proven:

  • python3 tools/port_ledger.py map-check tools/port_map/game2-023.tsv → 150 rows, no problems.
  • grep -n 'back_up_unreadable_player' crates/horizon-client/src/save.rs → 3065: (the function, read_dat(path).is_none() → <stem>_corrupted_<stamp>.dat) and 4219: (the player save calling it before the write)

Not proven:

  • I did not run the game: no corrupt player file was written and reopened to see the _corrupted_ copy appear.
  • The other rows of game2-023.tsv were not re-derived method by method; the verdicts I left alone were checked only for dangling paths, which map-check reports clean.

🔄 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/6857 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/ledger-game2023-playerbackup` --- ### 📝 Commits (1) - [`80f5297`](https://github.com/horizon-rust/horizon/commit/80f52974997e5b60ea02588324fdd83ce6fdbefa) port map: an unreadable player file is backed up before the save overwrites it ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/game2-023.tsv` (+1 -1) </details> ### 📄 Description `PlayerDataStorage.backup` copies a player file that fails to read to `<uuid>_corrupted_<time>.dat` beside it before the save writes over it, so a damaged player file is kept instead of being lost. `tools/port_map/game2-023.tsv` said it was missing: "a player file that fails to load is not copied to a _corrupted_ backup first; Horizon leaves it in place." It is ported: `save::back_up_unreadable_player` (`crates/horizon-client/src/save.rs:3065`, its doc naming the vanilla method) copies the file when it does not read, and the player save calls it before writing (`crates/horizon-client/src/save.rs:4219`). **Proven:** - `python3 tools/port_ledger.py map-check tools/port_map/game2-023.tsv` → `150 rows, no problems.` - `grep -n 'back_up_unreadable_player' crates/horizon-client/src/save.rs` → `3065:` (the function, `read_dat(path).is_none()` → `<stem>_corrupted_<stamp>.dat`) and `4219:` (the player save calling it before the write) **Not proven:** - I did not run the game: no corrupt player file was written and reopened to see the `_corrupted_` copy appear. - The other rows of `game2-023.tsv` were not re-derived method by method; the verdicts I left alone were checked only for dangling paths, which `map-check` reports clean. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:34:48 +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#7149
No description provided.