Skip to content

feat(mobile): tell users when a newer app binary is installable - #23755

Merged
Jinwoo-H merged 10 commits into
mainfrom
mobile-app-update-check
Sep 29, 2026
Merged

Jinwoo-H merged 10 commits into
mainfrom
mobile-app-update-check

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​661 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​661
Prod 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1258 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1258

What

With OTA, store releases of the mobile app are rare, so nobody looks for them. The app now tells users when a newer binary is installable, the way the desktop does.

Source of truth: whoever can install it. No manifest, no new tags, no backend, no release-workflow change.

  • Android sideload (today's channel: GitHub APK releases tagged mobile-android-v*): the app lists those tags from GitHub's public API, takes the newest plain-semver tag above the installed version, and confirms a published release with an .apk exists for it (a failed build leaves a release-less tag; at most three candidates are tried). Tap opens that release's page. The releases atom feed and the first page of the releases list were rejected: both are newest-first windows that desktop releases fill, and a pushed-out mobile release would silently read as "current". Every mobile release is a pre-release, so that flag is not filtered on.
  • iOS App Store: Apple's lookup by bundle id, which reflects what is live. Tap opens the App Store page. TestFlight builds stay quiet because they are at or ahead of the store version and there is no receipt signal without a new dependency.
  • Google Play, later: one more implementation behind the same AppUpdateSource seam; nothing above it changes.

Cadence: the desktop's (src/main/updater-events.ts). Check on cold start when the last success is 24 h old, on foreground when due, retry after 1 h on failure, and a manual "Check for updates". A check is one 8 s-bounded request chain, single-flight, never on the render path. Last check time, last seen version and the dismissed version live in AsyncStorage; "available" is derived at render time as latest > installed, so installing the update clears it at once.

UI (approved mockup). Home: a card above DESKTOPS in the host-card style, "Orca 0.0.51 is available / Tap to update", monochrome icon, an X that dismisses that version only (it returns for the next one). Settings: "Update to Orca 0.0.51 / Update", which stays after dismissal; a plain "Version 0.0.48" row when current; and "Check for updates / Last checked 2 h ago". No launch modal, no toast, no badge, no colour accent.

Scope. Shell code only, so it ships in the next store build and both the native and OTA shells show it. The page bundle, the RPC wire and the existing compat wall are untouched. Installed version is the binary's embedded version (expo-constants), which the OTA page cannot change.

Tests

  • Scheduler with fake timers and an injected clock: 24 h cadence, 1 h retry, foreground trigger, single-flight join, 8 s bound, one load shared by a StrictMode double start, nothing written after stop, a manual failure during load keeps the retry, a stored check time ahead of the clock reads as never checked.
  • Sources against recorded GitHub and App Store replies: newest tag selection, fallback past a release-less tag, 404 continues while 5xx/network rejects, the release's own html_url is used, prerelease-suffixed tags ignored, App Store empty/lower/non-semver all read as current.
  • Preferences: a corrupt stored record loses only that key.
  • Card and Settings rows rendered through the RN-web row test pattern.
  • Emulator (Pixel 9 Pro API 36) with fixtures served through the seam: card above DESKTOPS, manual check, dismissal surviving a cold restart while Settings keeps the row.

With OTA page updates, store releases get rare and users stop looking.
The shell now asks the channel that installed it. Android sideload
reads GitHub's mobile-android-v* tag refs and proves the release has
an APK. iOS reads the App Store lookup. A home card above Desktops,
dismissible per version, and Settings rows surface the result. The
check runs on the desktop updater's cadence: cold start, foreground
once 24 h have passed, and a 1 h retry after a failure.

The releases atom feed was not used because it lists only the 10
newest releases, which are all desktop builds, so it never carries a
mobile tag.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The anti-slop gate refuses Reflect.get on dynamic input. The GitHub
refs, the release, the App Store lookup and the stored update record
are now parsed into named schemas before they are read.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Record why the Android source reads tag refs. The releases atom feed
and /releases?per_page=100 are both newest-first windows that desktop
releases fill. Either would silently report "current" once a run of
desktop builds pushes the newest mobile release out.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Every check and dismissal now awaits one shared store load. This
replaces the merge that guessed whether a check had landed during the
load. A manual check that fails while the store loads therefore keeps
its 1 h retry instead of re-checking at once.

- checking is derived from the in-flight check.
- start() uses a per-start flag, so a StrictMode double start applies
  one load.
- A check that finishes after stop() writes nothing.
- A corrupt stored update record loses only itself.
- Tag refs are parsed with a single schema.
- The runtime wiring is folded into one file, and the card moves to
  home/.
- The recorded App Store fixture is oxfmt-formatted, with the same
  parsed value.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
A check that stayed in flight across stop and restart returned
'failed' without rescheduling. The restart skipped arming because a
check was in flight, which left a live checker with no timer until
the next foreground. The stop counter is removed. schedule() already
arms nothing while no start is active, and saving a real result after
a stop is harmless.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Mobile app update checker and UI.

The PR appears safe to merge; no actionable new issue or outstanding previous finding was established.

Summary

The PR adds native mobile binary-update checks, persisted results and dismissal, and update entry points on Home and Settings.

  • Android checks GitHub mobile release tags for a published APK; iOS checks the App Store listing.
  • The changes since the previous review use the lookup’s listing URL and check immediately when a saved check time is ahead of the clock.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Start[Cold start or foreground] --> Checker[Update checker]
  Manual[Manual check] --> Checker
  Checker --> Source{Installed platform}
  Source -->|Android| GitHub[GitHub tags and APK release]
  Source -->|iOS| Apple[App Store lookup]
  GitHub --> State[Saved check result]
  Apple --> State
  State --> Home[Home update card]
  State --> Settings[Settings update row]
Loading

Reviews (4) · Last reviewed commit: "style(mobile): fit the future-check-time..."

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 00fce8d0-0452-423c-aee3-9aaff4473c5c

📥 Commits

Reviewing files that changed from the base of the PR and between c39a11e and b4ab74c.

📒 Files selected for processing (4)
  • mobile/src/app-update/app-store-update-source.ts
  • mobile/src/app-update/app-update-checker.test.ts
  • mobile/src/app-update/app-update-checker.ts
  • mobile/src/app-update/app-update-sources.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The mobile app now checks Android GitHub releases and iOS App Store listings for newer versions. It stores check results and dismissed versions, schedules checks and retries, and starts the checker when the root layout mounts. The home screen displays available updates with update and dismiss actions. Settings displays version and check status and provides a manual check action.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b4ab7

The new mobile flow checks for updates and surfaces available releases. A backward clock adjustment does not strand its scheduled check, and no concrete issue in the reviewed changes warrants delaying merge.

Security Architecture Review

Security architecture risk: 🔵 Low · up to b4ab7

Update links come from fixed Apple or GitHub services and open only after a user taps, but the app does not restrict a returned link to the expected store or release page. This creates a limited, conditional risk if update data is manipulated.

Retained concerns

  • Low · security · inferred: Release metadata and cached update records can supply an unrestricted URL to the user-triggered platform opener. If either value is manipulated, the update action could open a destination or scheme outside the intended App Store or GitHub release page; practical attacker control is not established.
Security review details

Security Blast Radius

  • inferred — The demonstrated path affects a mobile user's update action and external navigation. The inspected path does not establish cross-tenant access or added service privileges; manipulation of provider responses or device storage remains unproven.

Security Findings and Attack Paths

  • inferred — If an update response or saved result were manipulated to contain another URL, a user pressing Update could hand that URL to the platform opener. This is a conditional path, not a verified means for an ordinary remote attacker to control the response.

Trust Boundaries and Controls

  • observed — The fetch destinations are fixed HTTPS services. Shape, version, and Android published-release-with-APK checks precede availability; the later URL-opening boundary does not recheck the destination.

Resilience and Maintainability Implications

  • observed — Single-flight checks, a timeout, and rechecking the installed version limit repeated requests and stale notices. They do not establish that a previously saved destination belongs to the expected provider.

Hardening Proposals

  • proposed — Constrain each source's listing URL to its intended HTTPS store or repository-release destination, and enforce the same policy when opening a cached result.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the implementation and testing in detail, but it does not follow the required template. It omits the ELI5, Why, Linked Issue, Visual Proof, Review, Notes, Agent skill upstream… Add the missing template sections. Provide the linked issue, the rationale and plain-language summary, visual proof or an explicit N/A explanation, review and compatibility notes, the Agent skill upstream boundary confirmation, and the comp…
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: notifying mobile users when a newer installable app binary is available.
Full details: Description check

Explanation

The description explains the implementation and testing in detail, but it does not follow the required template. It omits the ELI5, Why, Linked Issue, Visual Proof, Review, Notes, Agent skill upstream boundary, and Checklist sections. The UI change also lacks before-and-after proof or an explicit N/A justification.

Resolution

Add the missing template sections. Provide the linked issue, the rationale and plain-language summary, visual proof or an explicit N/A explanation, review and compatibility notes, the Agent skill upstream boundary confirmation, and the completed testing and checklist items.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one low-probability scheduler edge and one forward-looking assumption, both inline.

Reviewed changes

  • Android source — reads git/matching-refs/tags/mobile-android-v, filters tags newer than installed, numerically sorts descending, probes at most three releases for a published release carrying an .apk, and opens the release html_url.
  • iOS source — Apple lookup by bundle id, offers when the store version is newer, opens the app's App Store page.
  • Scheduler — createAppUpdateChecker with the desktop cadence (24h interval, 1h retry, 8s bound, cold-start/foreground-when-due, single-flight, dismissal scoped to one version).
  • Persistence — three AsyncStorage keys; a corrupt latest record is dropped without losing the check time or dismissal.
  • UI — home card above DESKTOPS (dismissible per version) and Settings rows (Update row survives dismissal; manual check with relative "last checked"), wired into _layout.tsx and settings.tsx.

ℹ️ Prior bot findings independently assessed

I checked greptile's two P1 Android findings against the live API and they do not reproduce: GET /git/matching-refs/tags/{prefix} ignores per_page, returns no Link header, and returned all 24 mobile tags (it has an undocumented ~500-ref cap and no pagination, irrelevant at this tag count), so nothing newer is dropped; and the three-probe bound is the documented behavior, not a regression.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

- The load sets prefs and the due time only. start() re-arms the
  schedule after it.
- The Settings result hides through one effect keyed on the result.
- onUpdate receives the URL.
- The version row is bound once.
- The retry and timeout constants are no longer exported.
- The unused AppUpdateChecker type is deleted.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The armed timer is the due time. Re-checking the wall clock when the
timer fired meant a clock stepped back skipped the check and re-armed
nothing. The due-time guard now applies only on foreground.

The binary version still comes from expoConfig.version. SDK 55
removed Constants.nativeAppVersion, so the no-expo-updates invariant
is now named in the comment.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Scheduler clock-step fix — The armed timer now runs the check directly (if (activeStarts > 0 && inFlight === null) void checkNow()) instead of routing through runIfDue(), so a backward wall-clock step no longer leaves no timer armed; the deps.now() >= nextDueAt guard stays only on the foreground path. ensureLoaded now just records nextDueAt and start() arms it. The added test genuinely fails on the old code.
  • Settings result auto-hide — settings-app-update-section.tsx replaces the manual useRef timer with a useEffect([result]) cleanup, and the update row's onUpdate now passes the url so the caller can hand openAppUpdate straight through.
  • Settings rows — Extracts a versionRow element; the separator is rendered only when that row exists. Behavior and rendered output unchanged (tests pass).
  • Dead exports removed — APP_UPDATE_RETRY_INTERVAL_MS, APP_UPDATE_CHECK_TIMEOUT_MS and type AppUpdateChecker are no longer exported; no in-repo importers.

Both prior pullfrog threads (the scheduler stall and the expo-updates dependency invariant) are addressed by c39a11e. Verified the two changed mobile suites (19 tests) and pnpm --dir mobile run typecheck locally.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

If the device clock was ahead when a check ran and was corrected
later, the stored check time is in the future. Cold starts then armed
a timer for the whole skew, and foreground never came due. The stored
state now reads as never checked in that case.

The iOS link is the lookup's trackViewUrl instead of a URL built from
trackId.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Future check-time recovery — ensureLoaded now treats a stored lastCheckedAt that is null or ahead of the injected clock as never checked (nextDueAt = 0), so a backward clock correction no longer defers the daily check indefinitely. The added test ("treats a stored check time ahead of the clock as never checked") genuinely fails against the previous lastCheckedAt + interval logic.
  • iOS link from Apple's reply — app-store-update-source.ts now returns the lookup's own trackViewUrl instead of constructing https://apps.apple.com/app/id{trackId}, and the zod schema drops trackId accordingly. The recorded fixture carries trackViewUrl; the sources test asserts the exact value.
  • Comment width — b4ab74c reflows the new future-check-time comment only.

Both prior pullfrog threads (the timer/clock-step stall and the expo-updates installed-version invariant) were already addressed and resolved at c39a11e; nothing remains open.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant