Truly resolve update feature UX? - #131
Conversation
|
I asked ChatGPT if what we just made here should be enough to fix the abandoned implementation:
|
/**
* Single source of truth for update UI:
* - Available
* - Downloading
* - ReadyToInstall
*/
1a18fcb to
db2e184
Compare
72e0e7c to
f5c6a49
Compare
|
Any internal apk download would trigger android check of dangerous app |
|
Android frequently triggers check of dangerous app with the Mandacaru releases I download with Chrome anyway, so I don't consider that scan a big deal. Apparently that behavior won't change no matter whose code is used. I suspect it's not been every single time because my own device's dangerous app scan was the first one that was ever done for various releases (or the first one that it thought was ever done; perhaps that was done somewhere else & just hadn't propagated through the internet to me yet). P.S. Do you need me to update my fork branch or anything, or can you do what is needed on your end? This is my first massive PR. |
|
#94 do you still get this play protect error? it was caused by the apk download feature |
As I basically said above, I have gotten the play protect error when I tried to install multiple versions of Mandacaru via Chrome downloads - it wasn't only caused by Mandacaru's short-lived internal apk download - it happened before it was born & after it died. The only way to silence the error seems to be to grant install unknown apps permission to the app that downloaded the apk - whether it's Chrome, or Mandacaru again. Now, how do I resolve my branch conflicts? Can't automatically merge... |
|
This is actually a very useful test. It shows several distinct bugs, and they line up with the architecture we built. Here's what happened versus what should have happened. Expected | Actual | Diagnosis -- | -- | -- Dot appears for new release | ✅ | Release detection works. "Get Update" downloads APK |So there are really three independent bugs. Bug 1: The UI is still in "release page" modeYou said the button still says
That means but displaying the old text. Earlier we intentionally left that temporarily while wiring everything together. Now the button should become state-dependent:
instead of always showing "Open release page". Bug 2: Completion isn't updating the UIYou observed
That means is broken somewhere. Either never stores the URI, or never recomputes the UpdateState after the download finishes. This is probably the biggest remaining bug. Bug 3: Duplicate downloadThis is the one you explicitly wanted to eliminate months ago. Current behavior:
That means returned even though the APK already existed. So one of these is wrong:
The good newsThe original failure that caused the maintainer to revert was much worse. Originally it was approximately
every time because nothing tracked downloads. Now you have The remaining issue is that the app forgets it has already downloaded it. That's a much smaller problem than where the project started. What I would fix nextIn this order:
Once those four are working, the flow becomes what you originally described: At that point, the duplicate-download problem should disappear because |
…issions for APK installer
|
I LOLed when I saw the 14.1 release GitHub email notification just before my debug app picked it up too. Another checkpoint debug apk after hours of rinse & repeat, now: screen-20260720-111505downscaled.mp4
Edge cases, I say? Removed automatic recovery of APKs left in Downloads after app storage reset. These files may remain visible to the user but are no longer safely owned by Mandacaru, and Android does not provide a reliable way to reclaim externally stored APKs without an active DownloadManager/content URI grant. Documented this as an unsupported recovery case: users can manually install a remaining APK from Downloads. A future PR may add a user-assisted "Open Downloads" flow, allowing Mandacaru to detect a newer installer APK and guide the user to complete installation manually. |
|
Coming back to deving this app after frying my brain on my intercom release & post-release work... My debug APKs have picked up all 3 of the 14.x releases. Just tried something I hadn't before, stopping the update download from the notification drawer & seeing what happens: I can start the download anew right away with Mandacaru's Download update button without a relaunch. No file is created, so no duplicate -# files can be either, in that case. Repeated a couple times. Good. So, what's left before I flip this draft to ready for review so everything can get into your app signing pipeline? Removing all the debug logging I added for my ADB investigations along the way, resolving merge conflicts, or... ? Not a rhetorical question, I'm still new at this. |
Come now this all-tests-passed debug APK from this PR's branch installed on my phone without descriptors (which would fill my limited internal storage), so I can focus on testing it when the next release arrives; where the debug APK flow should now be:
Automatic update check
Yes.
SettingsViewModel.observeUpdateStatus()callsappUpdateRepository.refresh(force = true)during initialization, so opening the app/settings should check for updates.The Check for updates action still lets the user manually refresh.
Update available UI
updateStatus.isUpdateAvailableis true.In-app download
Pressing Get Update should enqueue an Android
DownloadManagerdownload into the default Android Downloads folder, for ease of later deletion (or re-installation).It should not open Chrome anymore.
Download progress
Your
UpdateStateResolverpollsDownloadManagerand should transition the UI toUpdateState.Downloading.The settings screen should show the progress indicator you added while the download is active.
Download complete
UpdateDownloadReceivershould receive the completion broadcast.It marks the download complete in
UpdateDownloadRegistry.Android notification
Ready to install
The resolver should return
UpdateState.ReadyToInstall(uri).SettingsViewModelsendsSettingsEvents.OpenInstallPrompt(uri).The UI should present the install prompt, and accepting it launches the Android package installer.