Skip to content

1.30.0: automatic updates (#49) - #51

Merged
mhoogenbosch merged 5 commits into
mainfrom
feature/auto-update
Oct 25, 2026
Merged

mhoogenbosch merged 5 commits into
mainfrom
feature/auto-update

Conversation

@mhoogenbosch

Copy link
Copy Markdown
Owner

Phase 2 of #49: automatic updates.

What

  • Advanced install gets Automatic updates (off by default) and a quiet window (default 03:00–05:00, may cross midnight).
  • Every 10 minutes each TV checks: enabled, inside the window, an update available (and not skipped), not yet attempted this night, reachable, no popup on screen, no other TV installing (domain-wide lock). Then the same install as the button: ADB, or the app's own update where that is silent.
  • Unattended ADB runs never open the app on a TV that is on (tv_in_use): the install landed, the app starts when the TV is switched on.
  • Results: logbook entry + log; last_auto_update / auto_update_failures attributes (restored after a restart, so a restart inside the window does not retry); repair after 3 failed nights or at once for not_authorized / signature_mismatch / key problems; cleared on success.
  • Options refuse automatic updates on the app route of a TV that needs the remote (auto_update_needs_adb).
  • The shared APK is kept during the window (one download for all TVs) and dropped after it.

Tested

  • 122 tests (20 new in tests/test_auto_update.py: window arithmetic incl. midnight, once a night, retry next night + repair after 3, immediate repair, skips without using the night, disabled/offline, tv_in_use, app route on Android 12+, app route needing the remote, one TV at a time, restart inside the window, options refusal).

🤖 Generated with Claude Code

mhoogenbosch and others added 5 commits October 25, 2026 21:46
Per TV in Advanced install: automatic updates with a quiet window. Once a
night, one TV at a time, never with a popup on screen, never opening the app
on a TV that is on. Logbook on success, retry next night on failure, repair
after three nights or at once for user-fixable causes. Record restored over
restarts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- an update by hand (or the app's own check) clears failed nights and the
  repair; switching automatic updates off clears it too
- an unexpected error in the tick is recorded as the night's attempt
- a restart during an app-route run picks the run up again
- wall-clock comparison for 'already tried tonight' (repeated DST hour)
- one rule for 'needs the remote' in options and tick (apps without silent)
- one TV at a time also while an app-route run is underway
- no nightly reinstall after tv_in_use; readable reasons; overdue app runs end
- tests for each

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The skip after tv_in_use matched any success with to == latest, so a TV
put back on an older build afterwards would never update automatically
again. The record now carries waiting_for_tv; the test pins it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mhoogenbosch
mhoogenbosch merged commit d477be4 into main Oct 25, 2026
2 checks passed
@mhoogenbosch
mhoogenbosch deleted the feature/auto-update branch October 25, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant