[pr-fix][startup] DARNER_UPDATE_CHECK=0 in darner-settings.txt or --set turns the update check off #278

Open
mdrzn wants to merge 1 commit from mdrzn/Darner:update-check-settings into main
First-time contributor

Contributor role (optional)

  • Fluxer ID: 1576254976387190787

What it changes

  • The problem on main: with DARNER_UPDATE_CHECK=0 in darner-settings.txt, the start still printed "A newer Darner is out: v2026.12.03.02 (this is v2026.12.01.01)".

check_for_update() runs in play::prepare before darner-settings.txt is read, and looks only at the process environment. play passes the settings file's switches to the title's process, not to itself, so DARNER_UPDATE_CHECK=0 written in the file (or given with --set) never reached the check, and the request went out anyway.

The check now runs right after the settings file is read. It is off when --set, the settings file or the environment says DARNER_UPDATE_CHECK=0, in that order. Nothing else moves: the check still starts before the title, in its own thread.

How it was tested

  • Tested revision: 3146141 (on main f3840d7).
  • Commands and results:
    • New unit test the_update_check_follows_the_settings_file_and_set: settings file only, --set only, --set over the file, the file's last line wins. the_update_check_names_only_a_newer_release still passes.
    • In the game: two release builds named v2026.12.01.01 (DARNER_BUILD_NAME), each started with darner play and DARNER_UPDATE_CHECK=0 in darner-settings.txt. Without this change the start printed "A newer Darner is out: v2026.12.03.02 (this is v2026.12.01.01)". With it, nothing was printed.
  • Changes a default: no.
  • Gates run on 3146141: gate 1 and gate 2 pass. Gate 3: everything passes except emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders in darner-shader ("Not all elements of output SV_Depth were written"). It fails the same way on main f3840d7 without this change.
  • Hardware dependence: none.
  • Coverage gaps: the request itself is not mocked in the unit test.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none
## Contributor role (optional) - Fluxer ID: 1576254976387190787 ## What it changes - The problem on main: with `DARNER_UPDATE_CHECK=0` in `darner-settings.txt`, the start still printed "A newer Darner is out: v2026.12.03.02 (this is v2026.12.01.01)". `check_for_update()` runs in `play::prepare` before `darner-settings.txt` is read, and looks only at the process environment. `play` passes the settings file's switches to the title's process, not to itself, so `DARNER_UPDATE_CHECK=0` written in the file (or given with `--set`) never reached the check, and the request went out anyway. The check now runs right after the settings file is read. It is off when `--set`, the settings file or the environment says `DARNER_UPDATE_CHECK=0`, in that order. Nothing else moves: the check still starts before the title, in its own thread. ## How it was tested - Tested revision: `3146141` (on `main` `f3840d7`). - Commands and results: - New unit test `the_update_check_follows_the_settings_file_and_set`: settings file only, `--set` only, `--set` over the file, the file's last line wins. `the_update_check_names_only_a_newer_release` still passes. - In the game: two release builds named `v2026.12.01.01` (`DARNER_BUILD_NAME`), each started with `darner play` and `DARNER_UPDATE_CHECK=0` in `darner-settings.txt`. Without this change the start printed "A newer Darner is out: v2026.12.03.02 (this is v2026.12.01.01)". With it, nothing was printed. - Changes a default: no. - Gates run on `3146141`: gate 1 and gate 2 pass. Gate 3: everything passes except `emit::waterfall_tests::sampled_marks_restore_early_depth_only_when_safe_in_pixel_shaders` in `darner-shader` ("Not all elements of output SV_Depth were written"). It fails the same way on `main` `f3840d7` without this change. - Hardware dependence: none. - Coverage gaps: the request itself is not mocked in the unit test. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none
check_for_update() ran in play::prepare before darner-settings.txt was read,
and looked only at the process environment. play passes the settings file's
switches to the title's process, not to itself, so DARNER_UPDATE_CHECK=0
written in the file (or given with --set) was ignored and the request went out.

The check now runs right after the settings file is read, and is off when
--set, the settings file or the environment says DARNER_UPDATE_CHECK=0, in
that order. Test: the_update_check_follows_the_settings_file_and_set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
First-time contributor

Independent Windows build, gate, and code-read review of 3146141af (based on main f3840d73d). Not run in-game.

Environment

  • Windows 11 Pro 26H2 (build 26300.10075), Intel Core i9-14900K, NVIDIA RTX A2000 12GB (driver 621.47), Rust 1.98.1 (x86_64-pc-windows-msvc), MSVC 19.44.35230.

Measured results

  • Gate 1 (cargo clippy --workspace --all-targets --locked -- -D warnings): PASS
  • Gate 2 (cargo clippy --workspace --all-targets --all-features --locked -- -D warnings): PASS
  • cargo xtask policy: PASS (asset policy: 555 files ok)
  • cargo test --locked -p darner play::tests -- --nocapture: PASS (58 passed; 0 failed in 0.04 s, including the_update_check_follows_the_settings_file_and_set)

Findings

  1. Blocking: DARNER_UPDATE_CHECK is missing from players_own::NAMES (apps/darner/src/play.rs:1042-1089), so migrate_settings() offers to delete it right before update_check_off() reads it:
    • In prepare() (play.rs:2412-2435), migrate_settings(&menu_file) runs before parse_menu and check_for_update(update_check_off(&menu, &o.more)).
    • In migrated() (play.rs:1094-1119), any darner-settings.txt without DARNER_MENU_SETTINGS_VERSION=2 (for example, created by hand with DARNER_UPDATE_CHECK=0, upgraded from v1, or on a future version bump) flags every k.starts_with("DARNER_") && !players_own(&k) as an obsolete engine switch and offers to strip it from the file—immediately re-enabling the update check.
    • Suggested fix: Add "DARNER_UPDATE_CHECK" to players_own::NAMES (play.rs:1052-1088) and verify it is kept in an_older_settings_file_loses_its_engine_switches_once (play.rs:2876).
  2. Minor: Blank DARNER_UPDATE_CHECK= in darner-settings.txt shadows DARNER_UPDATE_CHECK=0 in the environment (play.rs:1625-1627):
    • Elsewhere in play.rs (settings() at :1371-1375, :1416), an empty KEY= in darner-settings.txt means unset. In update_check_off, saved produces Some(""), stopping set.or(saved).or_else(|| std::env::var(NAME).ok()) before checking the environment. Adding .filter(|v| !v.is_empty()) on saved matches settings().
  • Precedence (--set > darner-settings.txt > env), Safe Start interaction, and darner_core::renamed::new_names alias handling all match the rest of play.rs. Splitting out a small helper taking env: Option<&str> would also let the test cover the env fallback and VICTORY_UPDATE_CHECK alias deterministically without depending on live process env.

Verdict: Changes requested (add "DARNER_UPDATE_CHECK" to players_own::NAMES and ignore empty saved values).

AI-assisted: yes (Gemini 4 Neon).

Independent Windows build, gate, and code-read review of `3146141af` (based on `main` `f3840d73d`). Not run in-game. ### Environment - Windows 11 Pro 26H2 (build 26300.10075), Intel Core i9-14900K, NVIDIA RTX A2000 12GB (driver 621.47), Rust 1.98.1 (`x86_64-pc-windows-msvc`), MSVC 19.44.35230. ### Measured results - Gate 1 (`cargo clippy --workspace --all-targets --locked -- -D warnings`): **PASS** - Gate 2 (`cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`): **PASS** - `cargo xtask policy`: **PASS** (`asset policy: 555 files ok`) - `cargo test --locked -p darner play::tests -- --nocapture`: **PASS** (`58 passed; 0 failed` in 0.04 s, including `the_update_check_follows_the_settings_file_and_set`) ### Findings 1. **Blocking: `DARNER_UPDATE_CHECK` is missing from `players_own::NAMES` (`apps/darner/src/play.rs:1042-1089`), so `migrate_settings()` offers to delete it right before `update_check_off()` reads it:** - In `prepare()` (`play.rs:2412-2435`), `migrate_settings(&menu_file)` runs before `parse_menu` and `check_for_update(update_check_off(&menu, &o.more))`. - In `migrated()` (`play.rs:1094-1119`), any `darner-settings.txt` without `DARNER_MENU_SETTINGS_VERSION=2` (for example, created by hand with `DARNER_UPDATE_CHECK=0`, upgraded from v1, or on a future version bump) flags every `k.starts_with("DARNER_") && !players_own(&k)` as an obsolete engine switch and offers to strip it from the file—immediately re-enabling the update check. - **Suggested fix:** Add `"DARNER_UPDATE_CHECK"` to `players_own::NAMES` (`play.rs:1052-1088`) and verify it is kept in `an_older_settings_file_loses_its_engine_switches_once` (`play.rs:2876`). 2. **Minor: Blank `DARNER_UPDATE_CHECK=` in `darner-settings.txt` shadows `DARNER_UPDATE_CHECK=0` in the environment (`play.rs:1625-1627`):** - Elsewhere in `play.rs` (`settings()` at `:1371-1375`, `:1416`), an empty `KEY=` in `darner-settings.txt` means unset. In `update_check_off`, `saved` produces `Some("")`, stopping `set.or(saved).or_else(|| std::env::var(NAME).ok())` before checking the environment. Adding `.filter(|v| !v.is_empty())` on `saved` matches `settings()`. - Precedence (`--set` > `darner-settings.txt` > env), Safe Start interaction, and `darner_core::renamed::new_names` alias handling all match the rest of `play.rs`. Splitting out a small helper taking `env: Option<&str>` would also let the test cover the env fallback and `VICTORY_UPDATE_CHECK` alias deterministically without depending on live process env. **Verdict:** Changes requested (add `"DARNER_UPDATE_CHECK"` to `players_own::NAMES` and ignore empty `saved` values). AI-assisted: yes (Gemini 4 Neon).
First-time contributor

0450b2c addresses both findings in the review. Settings migration now keeps DARNER_UPDATE_CHECK. A blank saved value falls through to the environment while an explicit --set still takes precedence.

I ran the same seven cases against 3146141 and the follow-up using the production migration and option functions. The migration and both blank-value cases now preserve the opt-out, and all four control cases behaved the same. Both updated in-tree tests passed in the isolated Rust harness. The focused cargo check --locked --offline -p darner --bin darner --tests, asset policy and diff check passed.

If you cherry-pick or rebase this commit, please keep the Git author. If you fold it into your own commit, please add this trailer.

Co-authored-by: andrewpozdnakov7-jpg <[email protected]>

[0450b2c](https://git.gtahub.st/andrewpozdnakov7-jpg/Darner/commit/0450b2ccec0a01bf0fe4a72569433fdb1a23502a) addresses both findings in [the review](https://git.gtahub.st/TrustNo1/Darner/pulls/278#issuecomment-865242). Settings migration now keeps `DARNER_UPDATE_CHECK`. A blank saved value falls through to the environment while an explicit `--set` still takes precedence. I ran the same seven cases against `3146141` and the follow-up using the production migration and option functions. The migration and both blank-value cases now preserve the opt-out, and all four control cases behaved the same. Both updated in-tree tests passed in the isolated Rust harness. The focused `cargo check --locked --offline -p darner --bin darner --tests`, asset policy and diff check passed. If you cherry-pick or rebase this commit, please keep the Git author. If you fold it into your own commit, please add this trailer. `Co-authored-by: andrewpozdnakov7-jpg <296776509+[email protected]>`
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'update-check-settings:mdrzn-update-check-settings'
git switch 'mdrzn-update-check-settings'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'mdrzn-update-check-settings'
git switch 'mdrzn-update-check-settings'
git rebase 'main'
git switch 'main'
git merge --ff-only 'mdrzn-update-check-settings'
git switch 'mdrzn-update-check-settings'
git rebase 'main'
git switch 'main'
git merge --no-ff 'mdrzn-update-check-settings'
git switch 'main'
git merge --squash 'mdrzn-update-check-settings'
git switch 'main'
git merge --ff-only 'mdrzn-update-check-settings'
git switch 'main'
git merge 'mdrzn-update-check-settings'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
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
TrustNo1/Darner!278
No description provided.