Repository navigation
feat(mobile): notify Android users when a newer APK is released - #18089
soohanpark wants to merge 7 commits into
Conversation
Android ships as a sideloaded APK from GitHub pre-releases, so nothing told users a newer build existed. The home screen now checks the releases API at most once a day (and on foreground), shows a dismissable banner linking to the latest app-release.apk, and remembers a skipped version. The protocol block screen's "mobile too old" path opens that APK directly instead of the generic releases list, falling back to the Android-filtered releases page. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016f4PJ8fGB9kc2VsqfFJSuf
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe mobile app adds paginated Android release checks, validated APK URLs, and serialized update-state writes. Android users see a dismissible home-screen update banner that rechecks when the app returns to the foreground. Outdated Android clients use the latest APK URL or the releases page fallback. Tests cover release lookup, banner behavior, dismissal races, and protocol-block routing. The mobile documentation describes the update flow. Merge Risk: 🟡 Moderate · up to The Android update flow can compare against a version that differs from the installed binary, stop pagination before finding the newest APK, or remain suppressed if a request never settles, causing stale or missed update prompts. These are bounded but concrete correctness and availability risks, so merge should wait for fixes or explicit acceptance. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The implementation addresses issue Full details: Description checkExplanation The description is complete and follows the repository template. It explains the change and rationale, links issue Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 0bf46cc1-f122-4042-80c2-0c8409e427aa
📒 Files selected for processing (8)
docs/site/content/docs/mobile.mdxmobile/src/components/HostProtocolGate.test.tsmobile/src/components/ProtocolBlockScreen.tsxmobile/src/home/MobileHomeScreen.tsxmobile/src/mobile-release/AndroidUpdateBanner.test.tsxmobile/src/mobile-release/AndroidUpdateBanner.tsxmobile/src/mobile-release/android-update-check.test.tsmobile/src/mobile-release/android-update-check.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
Important
The release lookup is capped at the 30 most recent GitHub releases, which can silently drop the newest Android release once ~30 newer desktop releases have shipped — at which point the banner stops working for everyone. See the inline comment on ANDROID_RELEASES_API_URL.
Reviewed changes
- Android update check — new
mobile-release/android-update-check.tswith numeric version comparison,mobile-android-v*release filtering, and a 24h-throttled AsyncStorage-cached check with skip-version support. - Home banner — new
AndroidUpdateBannerrenders on Android above the host list, opens the APK on tap, dismisses to skip that version, and re-checks on foreground. - Protocol block screen — the Android "mobile too old" path now resolves the latest APK directly, falling back to the filtered releases list when the lookup fails.
- Docs — two lines in
mobile.mdxdescribing the new behavior.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Review follow-ups on stablyai#18089: - Walk /releases with per_page=100 and the Link header (capped at 5 pages) instead of trusting the first 30 entries; desktop ships roughly daily, so the newest Android release can sit past page one. - Build the APK URL from the release tag rather than reading it from asset metadata. - Serialize AsyncStorage reads/writes through a promise chain so a skip landing mid-check is not overwritten, and make the banner ignore a check that was already in flight when it was dismissed. - Reset the block screen's resolved APK URL on every lookup. - Reuse compareAppVersions from src/shared instead of a local comparator. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016f4PJ8fGB9kc2VsqfFJSuf
|
Review follow-ups landed in 7cb35aa (pagination, tag-derived APK URL, serialized state writes, block-screen reset, Docstring coverage warning: leaving as is. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior pullfrog review, commit 7cb35aa addresses both open threads and hardens the update-check state handling:
- Paginated the release lookup —
fetchLatestAndroidReleasenow follows theLinkheader up toMAX_RELEASE_PAGES(5 pages ×per_page=100), stopping at the first page that holds amobile-android-v*release, so the newest Android release is no longer lost behind ~30 newer desktop releases. - Reused
compareAppVersions— dropped the local dotted-version comparator in favor ofsrc/shared/app-version.ts. - Serialized state access —
checkForAndroidUpdateandskipAndroidUpdatenow run through awithStateLockpromise chain so a skip landing mid-check is not overwritten by the check's write. - Guarded dismiss during in-flight check — a
dismissGenerationref prevents a check already in flight from re-showing the banner after dismissal. - Derived the APK URL from the tag —
findLatestAndroidReleasebuilds the download URL from the release tag instead of trustingbrowser_download_url. - Reset block-screen state per verdict —
ProtocolBlockScreenclearsandroidApkUrlbefore each lookup so a prior verdict's URL cannot leak into a failing lookup.
Both prior threads are now addressed (pagination truncation, duplicate comparator) and the new code paths are covered by focused tests (fetchLatestAndroidRelease pagination/cap, skip-during-in-flight, dismiss-during-in-flight).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 67f1deac-b6a1-4b84-8a95-66725fd30038
📒 Files selected for processing (5)
mobile/src/components/ProtocolBlockScreen.tsxmobile/src/mobile-release/AndroidUpdateBanner.test.tsxmobile/src/mobile-release/AndroidUpdateBanner.tsxmobile/src/mobile-release/android-update-check.test.tsmobile/src/mobile-release/android-update-check.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- mobile/src/mobile-release/AndroidUpdateBanner.test.tsx
- mobile/src/components/ProtocolBlockScreen.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The GitHub request has no deadline, so holding the state queue across it left a dismiss queued behind a stalled check; killing the app before the request finished lost the skip and the banner came back. Fetch first, then re-enter the lock only to reload and merge before saving. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016f4PJ8fGB9kc2VsqfFJSuf
There was a problem hiding this comment.
ℹ️ No critical issues — the fetch-outside-lock refactor is sound; one minor observation inline.
Reviewed changes
Since the prior review (7cb35aa), commit d960f80 reworks checkForAndroidUpdate so the GitHub request runs outside the update-state lock:
- Moved the release request outside the lock —
checkForAndroidUpdatenow fetches before acquiringwithStateLock, soskipAndroidUpdateis no longer queued behind a request with no deadline; the save still re-reads state inside the lock to preserve a skip that landed mid-fetch. - Distinguished failed vs. empty checks — a thrown fetch maps to
undefinedand is skipped (leavingcheckedAtstale so the next foreground retries), while a successfulnullresult is persisted so the 24h throttle still applies. - Added a skip-during-inflight test — a never-resolving fetch plus a skip proves the skip persists immediately instead of blocking on the lock.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…hecks Moving the request outside the state lock dropped the serialization that kept a mount check and an AppState "active" check from each walking the release pages. Overlapping checks now await the same promise. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016f4PJ8fGB9kc2VsqfFJSuf
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior pullfrog review (d960f80), commit 3438041 addresses the last open thread and adds one new behavior:
- Shared the in-flight release request —
fetchLatestAndroidReleaseSharedcaches a single in-flightfetchLatestAndroidReleasepromise and clears it on settle, so a mount check and an AppStateactivecheck that overlap no longer each walk up toMAX_RELEASE_PAGESpages against the unauthenticated GitHub API. - Reworked the state-safety tests — the "skip during in-flight" and the new "shares one in-flight request" tests now drive a gated fetch to prove single-fetch dedup and that a skip persists without being queued behind the request.
One informational note, already acknowledged in the ponytail: comment: the shared cache means a request that stalls indefinitely (RN fetch has no default timeout) would pin inFlightRelease forever, so every later check re-awaits the same never-settling promise until the app restarts — a regression from d960f80, where a subsequent foreground would issue a fresh request. The suggested AbortController deadline would close that gap when convenient; not a merge blocker.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
mobile/src/mobile-release/android-update-check.ts (1)
72-77: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winScan all capped pages before selecting the highest Android version.
fetchLatestAndroidReleasereturns the first page that contains a qualifying release. GitHub orders releases by creation time, not semantic version, so a later page can contain a highermobile-android-v*tag. Aggregate qualifying releases across the capped pages and select the highest version withcompareAppVersions. Add a regression test for this case.Source: MCP tools
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: aab6ebca-97c6-4678-8b41-5166147eb02d
📒 Files selected for processing (2)
mobile/src/mobile-release/android-update-check.test.tsmobile/src/mobile-release/android-update-check.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016f4PJ8fGB9kc2VsqfFJSuf
React Native fetch has no default timeout, and the shared in-flight promise meant a stalled request pinned every later check until the app restarted. One 15s AbortController budget now covers the whole page walk, so a stall fails the check and the next foreground retries. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016f4PJ8fGB9kc2VsqfFJSuf
|
Follow-ups on the latest round:
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior pullfrog review (3438041), two commits land: a comment cleanup and a deadline for the release request.
- Bounded the release request with a deadline —
fetchLatestAndroidReleasenow wraps the paginated fetch in anAbortControllerwith a single 15s budget (REQUEST_TIMEOUT_MS), passessignalto every page fetch, and clears the timer infinally. A stalled request now settles instead of pinning the shared in-flight promise, so the next check can retry. - Dropped the scratch markers — removed the
ponytail:comments inandroid-update-check.tsandAndroidUpdateBanner.tsxnow that the deadline and pagination concerns they tracked are resolved. - Added an abort/retry test — a fake-timer test drives a fetch that only rejects on
abort, advancing past the deadline to prove the check settles tonulland a subsequent check issues a fresh request.
This directly resolves the informational note left on the prior review (a hung request pinning inFlightRelease forever); the abort rejection is mapped to undefined so the failed check is not persisted and the next foreground retries, and inFlightRelease is cleared on settle.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Verified on an Android emulatorRan this on a Pixel 7 / API 36 (
One rendering note for reviewers: the banner lays out over two lines, "Orca Mobile 0.0.47 is available" above "Download APK", because Not covered here: the |
…-update-check # Conflicts: # docs/site/content/docs/mobile.mdx
|
@AmethystLiang @brennanb2025 Hi both, sorry to bother you. When you have a moment, could you take a look at this PR? Since the issue thread, all CodeRabbit and pullfrog findings have been addressed with tests, the change has been verified on an Android emulator (screenshot above), and the branch has been merged with the latest main with conflicts resolved. Happy to make any changes that would make the review easier. Thank you! |
|
Following up in case my previous comment got buried. @AmethystLiang @brennanb2025, could either of you review this PR or help assign the right reviewer? Happy to address any feedback. Thank you! |
|
Hi @Jinwoo-H — sorry to tag you directly. This PR has been waiting for review for a few weeks, and I noticed you have been active in the mobile code recently. All automated review findings have been addressed, and the change was verified on an Android emulator. The PR has since developed conflicts with |


ELI5
Android users install Orca Mobile from an APK file, and nothing told them when a newer one existed. Now the app checks GitHub Releases once a day and shows a small banner with a download link.
What Changed
AndroidUpdateBannerchecks GitHub Releases on launch and on foreground, throttled to one request per 24h via AsyncStorage. It walksGET /repos/stablyai/orca/releases?per_page=100page by page (Link header, capped at 5 pages) until a page contains a non-draftmobile-android-v*release withapp-release.apk, and shows a banner when that version is newer thanConstants.expoConfig.version. Tap opens the APK in the browser (same install flow as today); dismiss skips that version. The download URL is built from the tag, not read from the response.releases?q=mobile-android-v) when the lookup fails. State is reset per lookup.compareAppVersionsfromsrc/shared/app-version.ts.docs/site/content/docs/mobile.mdx.No new dependencies.
Why
Android has no Play Store listing; APKs ship as GitHub pre-releases. The README and docs link a pinned version that goes stale, and the only in-app pointer was the protocol block screen sending users to a releases list dominated by desktop builds. Desktop ships roughly daily while Android ships every few days, so the lookup must paginate rather than trust the first page.
A check-and-prompt flow was chosen over in-app download and install because Android forbids silent installs for sideloaded apps; the remaining gain from an install intent is one tap, at the cost of a new dependency and the
REQUEST_INSTALL_PACKAGESpermission. That upgrade path is marked with aponytail:comment on the banner's tap handler.Linked Issue
Fixes #18101
Visual Proof
Captured on a Pixel 7 / API 36 Android emulator, with
expo.versiontemporarily set to0.0.40so a newer release exists to report. The banner sits under the home top bar in the existing notice-banner style (bgPanelbackground,borderSubtlebottom border, secondary text over anaccentBlue"Download APK" link, X to dismiss).Tap, dismiss, and relaunch behavior is walked through in the emulator verification comment.
Testing
Automated tests on a macOS host, plus a manual pass on a Pixel 7 / API 36 Android emulator (
expo prebuild --platform android+expo run:android). Not run on physical hardware.mobile/src/mobile-release/android-update-check.test.ts: release filtering (drafts, desktop tags, missing APK, lexical-vs-numeric versions), tag-derived URL, Link pagination and page cap, 24h throttle, skip, skip during in-flight check, failure retry, non-2xx handlingmobile/src/mobile-release/AndroidUpdateBanner.test.tsx: iOS renders nothing, Android checks with installed version and opens APK, foreground recheck, dismiss skips, dismiss during in-flight check stays hiddenmobile/src/components/HostProtocolGate.test.ts: Android block screen resolves the APK link and falls back on lookup failure (network mocked)Full mobile suite,
tsc --noEmit,oxlint,oxfmt --checkinmobile/I manually tested these changes locally (Pixel 7 / API 36 Android emulator; banner render, download tap, dismiss, and skip-persists-across-relaunch)
Automated tests added/updated, or explained why not below
AI Disclosure
Implementation and tests were written with Claude Code (Claude Fable 5.1) and reviewed by the author.
Review
Points worth a look: the 5-page cap in
fetchLatestAndroidRelease, the promise-chain lock inandroid-update-check.ts, and the dismiss generation guard inAndroidUpdateBanner.tsx.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
github.com/stablyai/orca/releases/download/; the GitHub API is read over HTTPS with no auth. Unauthenticated limit is 60 req/h/IP; one device makes at most 5 requests per day.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — mobile lint/typecheck/test run locally, build left to CI🤖 Generated with Claude Code
https://claude.ai/code/session_016f4PJ8fGB9kc2VsqfFJSuf