Updates: when a release may install by itself, as a state machine

Issue #52: once a newer release is known, wait for a quiet moment, ask
for 30 seconds, and install unless the answer is no. The caller says
what busy and idle are. Host-tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
2026-10-11 17:49:09 +02:00
co-authored by Claude Opus 5.5
parent 5af695f43a
commit 17651cb911
3 changed files with 223 additions and 0 deletions
+6
View File
@@ -24,6 +24,12 @@ inline bool shouldAnnounce(const Release& latest, const std::string& running, co
return isNewer(latest, running) && latest.tag != failed && latest.tag != announced;
}
// Should the background check offer to install it by itself (issue #52)? Any newer release, each
// day it is still the newest; never a version that rolled back on this device.
inline bool shouldInstall(const Release& latest, const std::string& running, const std::string& failed) {
return isNewer(latest, running) && latest.tag != failed;
}
// Is `url` a download this device takes from the project's server, for this repository? Whatever
// the API says, the device only fetches from where it asked (a redirected or rewritten answer
// can't send it elsewhere).