Preserve F1 settings when a save fails #2256

Manually merged
github merged 1 commit from github-bot/gh-2256 into main 2026-11-30 14:14:37 +00:00 AGit
Owner

@⁠ThePerfomance on GitHub · 2026-11-29 11:06 UTC · original
ThePerfomance:fix/f1-settings-persistence → main · +122 −8 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC

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.
**@⁠ThePerfomance** on GitHub · 2026-11-29 11:06 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2256) `ThePerfomance:fix/f1-settings-persistence` → `main` · +122 −8 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC ## 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.
Stage the complete settings file beside its destination and replace it after the write succeeds. Preserve unreadable settings and report reset errors instead of claiming success.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 11:06:39 +00:00
github manually merged commit dbffdb927c into main 2026-11-30 14:14:37 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2256
No description provided.