Preserve F1 settings when a save fails #4943
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4943
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4942"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@andrewpozdnakov7-jpg on GitHub · 2026-12-01 14:56 UTC · original
andrewpozdnakov7-jpg:codex2/fix/f1-atomic-settings-save→main· +34 −11 · 1 files · 1 commits · closed without mergingRefs #4940, point 3.
What it changes
The F1 rewrite on
mainopened the settings file for overwrite even after a read failure. Saving one changed setting could then replace the other saved values. This restores the F1 persistence safeguards from #2256. Read errors reach the menu, and a successful save writes and syncs a temporary file beside the target before replacing it. An existing settings symlink is resolved before the write.How it was tested
5fabb46eand294f3b3f017182e7beda54c8e929444ad83441d0on synthetic files.cargo xtask policy --stagedaccepted the changed file.Checked for overlap
menu.rs. #2868 deals with launch-time settings precedence and reset. #4935 saves the game's separate settings XML.Please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding the change into another commit.AI-assisted with OpenAI Codex.
[pr-fix][startup] Preserve F1 settings when a save failsto Preserve F1 settings when a save fails@gut0to on GitHub · 2026-12-01 15:12 UTC · original · reviewed
AI-assisted review: I inspected the settings save path and the failure handling in this diff. I used AI assistance and verified the test gap against the current source.
@ -1186,0 +1187,4 @@let previous = match std::fs::read_to_string(path) {Ok(text) => text,Err(error) if error.kind() == io::ErrorKind::NotFound => String::new(),Err(error) => return Err(error),@gut0to on GitHub · 2026-12-01 15:12 UTC · original
Could this failure path get an in-tree regression test? This change prevents a read/parse error from replacing the saved settings, but the reported fixture is external to the repository. A temp-file test with invalid UTF-8 (or another read_to_string error) could call write_settings and assert the original bytes remain unchanged; a failed atomic replacement should likewise leave self.started unchanged. That would make the central corruption fix durable.
github-bot referenced this pull request2026-12-01 16:12:28 +00:00
@andrewpozdnakov7-jpg on GitHub · 2026-12-01 18:29 UTC · original
Current main already resolves a settings symlink, preserves the previous file on a read failure, and syncs a temporary file before replacing it. Closing this proposal as superseded. Source checked at 93aa9a92.
Pull request closed