Preserve F1 settings when a save fails #2256

Merged
ThePerfomance merged 1 commit from upstream-pr/2256 into main 2026-11-30 14:12:03 +00:00
ThePerfomance commented 2026-11-29 11:06:18 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ThePerfomance on 2026-11-29T11:06:18Z.


What it changes

F1 currently truncates the destination before writing the new settings, treats any read failure as an empty file, and reports a successful reset even if deleting the file failed.

Stage the full contents in a uniquely named sibling temporary file, sync it, and replace the settings file only after that succeeds. An unreadable existing file is preserved. Reset still succeeds when the file is already absent and reports other errors in the menu.

How it was tested

  • On Windows with Rust 1.98.1 MSVC, all 17 F1 menu tests passed without launching a title. The new tests exercise a real file that permits ordinary writes but denies replacement, verify that the old bytes and pending edits survive, and verify a successful retry after the handle closes. They also cover unreadable settings and the success, missing-file, and failure cases for reset.
  • All three regression cases failed against the previous menu logic in an isolated Windows file test and passed with the patch. The staged asset policy and git diff --check passed.
  • The complete victory-gpu library suite passed with 918 tests and 57 ignored.
  • The full workspace run stopped with three BC7 oracle-parity failures in victory-formats. This PR does not touch that crate, its inputs, or workspace dependencies.

Checked for overlap

  • Checked current main and open PRs touching the menu. #1382 includes overlapping persistence and reset changes as part of the native Graphics menu. #1981 also moves F1 persistence into a shared backend. This PR offers the standalone one-file fix for the existing F1 menu, with regression tests for the failure paths.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5550099228 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2256). Originally posted by [ThePerfomance](https://github.com/ThePerfomance) on 2026-11-29T11:06:18Z. --- ## What it changes F1 currently truncates the destination before writing the new settings, treats any read failure as an empty file, and reports a successful reset even if deleting the file failed. Stage the full contents in a uniquely named sibling temporary file, sync it, and replace the settings file only after that succeeds. An unreadable existing file is preserved. Reset still succeeds when the file is already absent and reports other errors in the menu. ## How it was tested - On Windows with Rust 1.98.1 MSVC, all 17 F1 menu tests passed without launching a title. The new tests exercise a real file that permits ordinary writes but denies replacement, verify that the old bytes and pending edits survive, and verify a successful retry after the handle closes. They also cover unreadable settings and the success, missing-file, and failure cases for reset. - All three regression cases failed against the previous menu logic in an isolated Windows file test and passed with the patch. The staged asset policy and `git diff --check` passed. - The complete victory-gpu library suite passed with 918 tests and 57 ignored. - The full workspace run stopped with three BC7 oracle-parity failures in `victory-formats`. This PR does not touch that crate, its inputs, or workspace dependencies. ## Checked for overlap - [x] Checked current `main` and open PRs touching the menu. #1382 includes overlapping persistence and reset changes as part of the native Graphics menu. #1981 also moves F1 persistence into a shared backend. This PR offers the standalone one-file fix for the existing F1 menu, with regression tests for the failure paths.
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
trustno1-coder/VIctory-NVIDIA!2256
No description provided.