launcher: update checks follow the copy in use (beta), and run every 30 minutes #3425

Merged
leonida/mandy
OreoFR merged 1 commit from oreofr/launcher-global-2 into main 2026-12-04 03:42:36 +00:00 AGit

Pull request successfully merged and closed

Member

Launcher change: needs OreoFR's review. AI-assisted.

The beta "Up to date" report did not reproduce. A player on beta 73436f4a1 saw "Up to date" after Check now. On main c43bc6410 (and in the beta launcher at 73436f4a1, the same code), check_updates calls update_status(REPO, fetch=True, branch=followed_branch(settings, CHANNEL)). REPO is the beta copy (channel_repo, tools/leonida_launcher.py:302/:317), followed_branch is beta, and the beta copy comes from git clone --branch beta (clone_command), so it tracks origin/beta. Nothing is cached per path. Two runs:

  • a temporary origin whose beta moves ahead: behind 2, then Update Mandy fast-forwards the beta copy;
  • a copy at 73436f4a1 fetching from git.leonida.now: behind 5 (up to 0ce52e0c3).

The likely cause is that the check ran before beta moved (73436f4a1 was beta's newest commit at the time shown) and the window never checked again while it stayed open. This PR fixes that part.

Periodic checks (auto_check_due, a pure function; the window asks it every minute and on <FocusIn>):

  • every 30 minutes while the window is open;
  • when the window comes back to the front 10 minutes or more after the last check;
  • never while a game or an update runs, and never while a check is already running;
  • never against a source that is gone (check_due); only every 2 hours after a failed check (offline, busy, error);
  • check_updates: false in launcher.json turns these automatic checks off (the start check still runs, as before);
  • a found update shows in the Updates card and the rail; nothing is installed without Update Mandy.

Tests (tests/test_leonida_launcher.py):

  • AutoUpdateCheckTests, 8 tests on a fake clock: red on main (8 errors), green here;
  • BetaCopyUpdateTests, real git: the beta copy against a moving origin beta (check, no caching, Update Mandy's fast-forward), and a force-pushed beta reached through the backup/before-update-* branch. Both pass on main too: they pin behaviour that already worked.
  • all 29 standalone test files whose name contains launcher, tool, docs or i18n, plus test_text_write_line_endings, test_bug_report_info and test_win_launchers: pass (scripts/run_standalone_tests.py -j 8, Windows 11);
  • i18n JSON parse, check_no_game_data on the changed files, a single __main__ block.

No new UI strings. The game was not started (not needed).

🤖 Generated with Claude Code

Launcher change: needs OreoFR's review. AI-assisted. **The beta "Up to date" report did not reproduce.** A player on beta 73436f4a1 saw "Up to date" after Check now. On main c43bc6410 (and in the beta launcher at 73436f4a1, the same code), `check_updates` calls `update_status(REPO, fetch=True, branch=followed_branch(settings, CHANNEL))`. `REPO` is the beta copy (`channel_repo`, `tools/leonida_launcher.py:302`/`:317`), `followed_branch` is `beta`, and the beta copy comes from `git clone --branch beta` (`clone_command`), so it tracks `origin/beta`. Nothing is cached per path. Two runs: - a temporary origin whose `beta` moves ahead: `behind 2`, then Update Mandy fast-forwards the beta copy; - a copy at 73436f4a1 fetching from git.leonida.now: `behind 5` (up to 0ce52e0c3). The likely cause is that the check ran before beta moved (73436f4a1 was beta's newest commit at the time shown) and the window never checked again while it stayed open. This PR fixes that part. **Periodic checks** (`auto_check_due`, a pure function; the window asks it every minute and on `<FocusIn>`): - every 30 minutes while the window is open; - when the window comes back to the front 10 minutes or more after the last check; - never while a game or an update runs, and never while a check is already running; - never against a source that is gone (`check_due`); only every 2 hours after a failed check (offline, busy, error); - `check_updates: false` in launcher.json turns these automatic checks off (the start check still runs, as before); - a found update shows in the Updates card and the rail; nothing is installed without Update Mandy. **Tests** (`tests/test_leonida_launcher.py`): - `AutoUpdateCheckTests`, 8 tests on a fake clock: red on main (8 errors), green here; - `BetaCopyUpdateTests`, real git: the beta copy against a moving origin `beta` (check, no caching, Update Mandy's fast-forward), and a force-pushed beta reached through the `backup/before-update-*` branch. Both pass on main too: they pin behaviour that already worked. - all 29 standalone test files whose name contains launcher, tool, docs or i18n, plus test_text_write_line_endings, test_bug_report_info and test_win_launchers: pass (`scripts/run_standalone_tests.py -j 8`, Windows 11); - i18n JSON parse, `check_no_game_data` on the changed files, a single `__main__` block. No new UI strings. The game was not started (not needed). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The reported "Up to date" on beta 73436f4a1 did not reproduce: update_status runs in the copy in use (the beta copy,
tracking origin/beta from git clone --branch beta) and saw the newer beta commits both against a temporary origin and
against git.leonida.now. The check was most likely made before beta moved, and nothing checked again while the window
stayed open. Real-git tests now pin the beta path (check, Update Mandy's fast-forward, the backup branch after a
rewritten beta).

The window now checks again by itself (auto_check_due): every 30 minutes, and when it comes back to the front 10
minutes or more after the last check; never while a game or an update runs, never against a gone source, only every
2 hours after a failed check; check_updates=false turns these off. A found update shows in the Updates card and the
rail; nothing installs without Update Mandy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OreoFR merged commit e1a13ab251 into main 2026-12-04 03:42:36 +00:00
Author
Member

Merging. Head 359aa9ac2 (on main c43bc6410), main c43bc6410 → e1a13ab25.

Local CI run by the merger on the head merged into current main (quick mode, launcher only): PASS, no failure (Compile Python, make_game.py --help, Python tests (standard library), no game data, sensitive files unchanged; Rust skipped: launcher only).

The beta player's "Up to date" did not reproduce: with a real temporary origin whose beta moves ahead, the check reports it and Update Mandy fast-forwards the beta copy. The likely cause was a check made before beta moved, never repeated while the window stayed open; this PR adds the automatic checks (every 30 min, on focus after 10 min, never while the game runs, 2 h back-off after errors, nothing installed without a click). The start-up check stays on even with an old saved check_updates: false (OreoFR's choice).

Launcher change approved by OreoFR (maintainer, launcher owner). Game not launched.

AI-assisted (Claude Code).

Merging. Head 359aa9ac2 (on main c43bc6410), main c43bc6410 → e1a13ab25. Local CI run by the merger on the head merged into current main (quick mode, launcher only): PASS, no failure (Compile Python, make_game.py --help, Python tests (standard library), no game data, sensitive files unchanged; Rust skipped: launcher only). The beta player's "Up to date" did not reproduce: with a real temporary origin whose `beta` moves ahead, the check reports it and Update Mandy fast-forwards the beta copy. The likely cause was a check made before beta moved, never repeated while the window stayed open; this PR adds the automatic checks (every 30 min, on focus after 10 min, never while the game runs, 2 h back-off after errors, nothing installed without a click). The start-up check stays on even with an old saved `check_updates: false` (OreoFR's choice). Launcher change approved by OreoFR (maintainer, launcher owner). Game not launched. AI-assisted (Claude Code).
Sign in to join this conversation.
No description provided.