Repository navigation
App update: one download at a time, each in its own file - #7
Merged
Merged
Conversation
Every tap on Update (home banner, Settings row, Settings button) launched a download into the same cache file. Two at once overwrote each other and the checksum check failed with "The download is corrupt". Now the view model runs one download at a time and the banner and Settings show it's downloading. Each download goes to a temp file of its own and is hashed as it streams, and a damaged download is retried once. Tests cover a clean download, a damaged one that's retried, one damaged twice, and two downloads at once (which fails on the old shared file). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ProjectZero02
force-pushed
the
app-update-once
branch
from
October 27, 2026 20:18
5c3ad7e to
affa489
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Right after 2.2.1 was published, the phone's in-app update failed with "The download is corrupt (checksum mismatch)".
The release is fine. Downloading
v2.2.1/PowerDeck.apkhere gives the same SHA-256 that GitHub's assetdigestandSHA256SUMS.txtlist (ebb9c1c5…871a6c), including with OkHttp's request headers through the redirect.Cause (app side).
cacheDir/update.apk. That includes the home banner, the Settings row and the Settings button.Fix.
MainViewModel.installUpdateruns one download at a time with the new stateAppCheck.Downloading. The home banner reads "Downloading PowerDeck X…" with no button; Settings shows the same with a spinner.Updater.downloadputs each download in a temp file of its own and hashes it as it streams, with no second read of the whole file.Tests (
UpdaterTest, MockWebServer with a throttled 512 KB body):update.apkthis test fails, which I checked by putting the old line back.Android unit tests: 67, all passing, and the screenshots are unchanged.
🤖 Generated with Claude Code