Public Access
Updates: a newer release installs by itself, after a question
With Settings > System > Install updates on By itself (issue #52), a release found by the daily check is offered once no key was pressed for 2 minutes and nothing would be cut by a restart. The question goes over whatever App is open, with Cancel and Accept, and installs after 30 s without an answer. Each update that held, and each one undone, is a dated line in /system/updates.log on the card. Tried on the device: the question, Cancel, and an install of v0.23.0 left unanswered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
@@ -51,7 +51,12 @@ class UpdateService : public Service {
|
||||
void requestList() { request_ = Request::List; }
|
||||
// Downloads `tag` (a release known from the last check or list) into the inactive slot and
|
||||
// installs it. "" when it started, or why not.
|
||||
std::string requestInstall(const std::string& tag);
|
||||
// `automatic`: nobody asked for it (issue #52), and the record of updates says so.
|
||||
std::string requestInstall(const std::string& tag, bool automatic = false);
|
||||
// A release the daily check found that may be installed without being asked for (the setting
|
||||
// is on): true once for each find, with its tag. The main loop picks the moment.
|
||||
bool takeOffer(std::string& tag);
|
||||
static constexpr const char* kRecordPath = "/system/updates.log"; // what was installed, and when
|
||||
bool giteaBusy() const { return request_ != Request::None || serving_; }
|
||||
// Asked to make room for a TLS connection (R1, Q172): IRC steps aside while the Update Service
|
||||
// talks to Gitea. Set by the main loop; `true` to step aside, `false` to come back.
|
||||
@@ -85,6 +90,7 @@ class UpdateService : public Service {
|
||||
void listen();
|
||||
void install(class UpdateSource& source, const char* via);
|
||||
void notify(const std::string& text, NotificationLevel level);
|
||||
void record(const std::string& what);
|
||||
|
||||
KeyValueStore& store_;
|
||||
WifiService& wifi_;
|
||||
@@ -103,7 +109,8 @@ class UpdateService : public Service {
|
||||
volatile Request request_ = Request::None;
|
||||
volatile bool serving_ = false;
|
||||
bool held_ = false; // IRC was asked to step aside, on this task
|
||||
std::string installTag_, fakeVersion_, announced_;
|
||||
std::string installTag_, fakeVersion_, announced_, offered_;
|
||||
volatile bool offer_ = false;
|
||||
bool dailyCheck_ = false;
|
||||
uint32_t nextCheckMs_ = 90000; // not before the device has settled
|
||||
std::string probeHost_, probePath_;
|
||||
|
||||
Reference in New Issue
Block a user