From ee47a612704f9f867f9a38cb5854f77c5ba72cb8 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 26 Aug 2026 08:34:28 -0400 Subject: [PATCH] android: find updates without being asked, fetch them, then nag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `check()` had exactly one caller: a button on the sync screen. So a new build was found only by someone who went looking for one — and having to remember to go looking is the same as not being told. The operator has been doing that by hand every time. Three parts. FIND. The app checks when it comes forward, which is the moment the person is present. Rate-limited to six hours in the view model, so flicking between two apps is not a re-check, and skipped entirely on an unlinked device — updates come from a linked server and there is nothing to ask. Same ForegroundTransitions shape as AutomaticSync, for the same reason. FETCH. Finding one downloads it, so the nag is a one-tap install rather than the start of a wait. NOT over mobile data: fifty-odd megabytes is a bill nobody agreed to, so this is gated on an unmetered connection (new ACCESS_NETWORK_STATE permission — normal, no prompt). On a metered link the update is still found and still nags; Install downloads it then, which is a choice rather than a surprise. NAG. A banner on the board, under the error banners — an update is worth saying and never worth saying before a note failed to save. "Later" clears it for this sitting only: the next time the app comes forward the check finds the same build and says so again. That is the difference between a reminder and a notice you can lose. downloadAndInstall now skips the download when the background fetch already did it, so the sync screen's button and the banner's are the same action with the same name — whether the bytes are already there is this class's problem, not the person's. --- android/app/src/main/AndroidManifest.xml | 3 + .../com/fabledsword/thoughtsync/AppUpdate.kt | 17 ++++ .../fabledsword/thoughtsync/MainActivity.kt | 46 +++++++++ .../fabledsword/thoughtsync/ui/BoardScreen.kt | 33 +++++++ .../fabledsword/thoughtsync/ui/UpdateCard.kt | 65 +++++++++++++ .../thoughtsync/ui/UpdateViewModel.kt | 94 +++++++++++++++++-- android/app/src/main/res/values/strings.xml | 3 + 7 files changed, 253 insertions(+), 8 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d80d757..5c53b18 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,6 +7,9 @@ this permission never exercised. --> + +