Skip to content

feat(mobile): tell Android users when their build is out of date - #11825

Closed
AboveColin wants to merge 5 commits into
stablyai:mainfrom
AboveColin:feat/mobile-update-check
Closed

AboveColin wants to merge 5 commits into
stablyai:mainfrom
AboveColin:feat/mobile-update-check

Conversation

@AboveColin

@AboveColin AboveColin commented Jul 31, 2026 •

Copy link
Copy Markdown

Summary

The mobile app is distributed as a sideloaded APK on GitHub Releases (.github/workflows/mobile-android-release.yml) — there is no store to announce a new build. An out-of-date app therefore fails silently, and it surfaces in the worst place: pairing rejects the desktop's offer with a bare "Not a valid pairing code", which reads like a bad paste rather than "this app is old".

That is how this was found: a stale APK refused a valid orca://pair?code=… offer, by QR and by paste, with no hint that the app was the problem.

1. Pairing rejections name their reason. parsePairingInput / parsePairingUrl return a typed PairingRejection instead of null. The offer version is read before schema validation, which is what makes an out-of-date app distinguishable from bad input, and the message names the side that is behind:

This pairing code is version 3, but this app only supports version 2. Update Orca on your phone.

QR and deep-link paths stay strict about the orca://pair route; only a deliberate paste may be a bare base64 code. parsePairingCode / decodePairingUrl stay as wrappers, so existing callers are untouched.

2. Startup update check (Android). On launch the app resolves the newest mobile-android-v tag and offers the release page.

Source of truth, measured rather than assumed:

  • /releases/latest is unusable — the Android lane publishes with --prerelease --latest=false, so it names a desktop build (v1.4.162).
  • /releases?per_page=30 would be a landmine: desktop publishes hourly, so Android entries sit deep and far apart. Measured 2026-08-01 on page 1 of 100: Android at indices 9, 26, 63, 64, 88, 89 — a gap of 37. A 30-item page can hold zero Android releases.
  • Chosen: git/matching-refs/tags/mobile-android-v, which filters by tag prefix server-side. One request, every Android tag, no desktop noise.

Budgets: at most one check per 24h, 5s abort, and every failure — offline, rate limited, malformed body — resolves silently with no prompt.

3. "Check for updates" toggle on About. Default-on, unlike push notifications: silence is the harmful default when nothing else can tell you. Off skips the request itself, not just the prompt.

Screenshots

No screenshots. The two new surfaces are a bottom drawer ("Update available", Get the APK / Later) and a Switch row on About, both built from the existing BottomDrawer and the Switch row pattern already used on the Notifications screen, with existing theme tokens only. Happy to attach captures from an emulator if a reviewer wants them.

Testing

  • pnpm lint — oxlint clean (mobile/)
  • pnpm typecheck — tsc --noEmit exit 0 (mobile/)
  • pnpm test — 380 files, 2829 passed, 3 skipped (mobile/)
  • pnpm build — not run; this PR touches only mobile/, which is built by the Expo/Gradle release workflow rather than the desktop build
  • Added or updated high-quality tests

New tests: release-tag parsing and numeric semver ordering; pagination (refs are oldest-first, so a full page must be followed); silent failure on rate limit, network error, malformed body and a stalled request; throttle window, backwards clock, opt-out and per-version dismissal; default-on preference and its opt-out round-trip; every pairing rejection reason; and a parity test pinning the mobile parser's accept/reject set to src/shared/pairing.ts across 29 inputs.

Also verified live against the real GitHub API: resolves 0.0.36, silent on 0.0.36, prompts on 0.0.30, honors dismissal.

AI Review Report

Reviewed with Claude. Risks checked: the update check's failure modes (offline, HTTP error, malformed body, hang, clock skew), whether an opt-out truly stops the network call, whether the pairing refactor changes what gets accepted, and the drawer's behavior when the release URL is missing.

What it flagged and what changed:

  • The version message pointed at the phone in both directions. Real bug — an older offer means the desktop is behind. Now direction-aware, with a test for both directions.
  • saveAutomaticUpdateCheckEnabled had no try/catch while being called with void — a failing write would surface as an unhandled rejection. Now swallowed like the neighbouring writes.
  • The About toggle rendered default-on before the stored value loaded, flashing ON for opted-out users and letting a quick tap be reverted by the load. Now renders only once the value is known.
  • Storage key used dots instead of the orca:camelCaseKey convention. Renamed.
  • A claim that the shared and mobile parsers had diverged. Measured instead of assumed: across 29 inputs they agree everywhere except uppercase scheme/host, which pre-dates this PR (main already matched case-insensitively and had a test for it, because QR alphanumeric mode encodes uppercase). Pinned in the parity test rather than silently changed — see Notes.

Cross-platform: this PR touches only mobile/, so no desktop macOS/Linux/Windows surface, no shortcuts, labels, shell behavior, or Electron paths are involved. Within mobile, the platform split is explicit: the check and its toggle are gated on Platform.OS === 'android', since iOS updates arrive through TestFlight. No path handling is introduced.

Security Audit

  • Input handling. The pairing parser is the security-relevant surface. It got stricter, not looser: the QR and deep-link paths now reject anything that is not the orca://pair route before decoding, so a bare base64 blob is only trusted from a deliberate paste. The parity test pins the accept/reject set against the shared implementation so a future edit cannot quietly widen it. All parsing stays inside try/catch with schema validation via PairingOfferSchema.
  • Secrets. Rejection messages report only the two integer version numbers — never the pairing code, device token, or public key. No new logging of offer contents.
  • Network. One unauthenticated GET to api.github.com over HTTPS, no credentials, no request body, no device identifier. The response is only read for ref strings matched against mobile-android-v<semver>; the opened URL is built from that validated tag, not from a server-supplied link, so a compromised or spoofed response cannot redirect the user to an arbitrary URL. Aborted after 5s.
  • Privacy. This is new outbound traffic to a third party: GitHub sees the device IP roughly once a day. The About toggle stops the request entirely, and it is disclosed in the UI copy.
  • No command execution, no filesystem paths, no IPC, and no new dependencies.

Notes

  • Android only. iOS is excluded at both the check and the toggle; TestFlight already notifies.
  • Pre-existing divergence, deliberately not fixed here. The mobile parser accepts ORCA://PAIR?code=… while src/shared/pairing.ts rejects it (URL.hostname is case-sensitive for non-special schemes). Mobile is right — QR alphanumeric mode encodes uppercase — so the shared/web copy is the one that should probably change. That is out of scope for this PR; it is pinned in pairing-shared-parity.test.ts so it stays visible.
  • Docstring coverage. A bot flagged 30% against an 80% threshold. Not addressed on purpose: AGENTS.md mandates concise, non-obvious comments only ("DO NOT be verbose, explain the obvious"). Adding docstrings to satisfy the ratio would contradict the repo's own style rule.

A single 'Not a valid pairing code' covered a wrong link, a truncated paste
and an app too old to understand the offer, so an out-of-date app looked like
a bad paste. parsePairingInput/parsePairingUrl now return the reason, and the
unsupported-version case reports both the offer version and the version this
app supports.

The QR and deep-link paths stay strict about the orca://pair route; only a
deliberate paste may be a bare base64 code.
Android ships as a sideloaded APK on GitHub Releases, so nothing ever tells
the user their app is out of date — an app too old to pair just failed with a
blank error. On startup the app now resolves the newest mobile-android-v tag
and offers the release page.

Not /releases: desktop publishes hourly releases and the Android lane
publishes with --prerelease --latest=false, so /releases/latest names a
desktop build and a /releases page can hold zero Android entries (measured
2026-08-01: newest Android at index 9, gaps of 37 between entries). The
git/matching-refs tag endpoint filters by prefix server-side instead.

Checked at most once per 24h, aborted after 5s, silent on every failure, and
Android-only — iOS updates arrive through TestFlight.
Default-on, unlike push notifications: a sideloaded APK has no store to
announce a new build, so staying silent is the harmful default here. Turning it
off skips the request itself rather than just the prompt, so the app stops
contacting GitHub entirely.

Android-only in the UI too — an iOS toggle would control nothing, since the
check never runs there.
@greptile-apps

greptile-apps Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR adds startup update notifications for sideloaded Android APKs and improves pairing error messages. Because the Android app is distributed outside any store, there was previously no signal to the user that their build was stale — a version mismatch silently presented as "Not a valid pairing code".

  • Update check: on Android launch (once per 24 h, opt-out toggle on About), the app queries git/matching-refs/tags/mobile-android-v, selects the highest semantic version, and shows a drawer prompt if the release is newer than the running build. The chosen endpoint is justified in detail: /releases/latest points at desktop builds and the paginated /releases list can contain zero Android entries per page.
  • Pairing rejections: parsePairingCode/decodePairingUrl now return a typed PairingParseResult; the version mismatch case surfaces both version numbers and identifies which side to update, while QR/paste/deep-link paths produce distinct copy.
  • About screen toggle: initializes to null until the stored value is read (fixing a prior flash-and-race on opt-out users), and the UI element is hidden on iOS where the check never runs.

Confidence Score: 5/5

Safe to merge. All new code is Android-only, opt-out, and resolves silently on every failure path; pairing changes are backward-compatible.

The update-check path is purely additive and fails silently in every error case (offline, rate-limited, malformed body, timeout). The pairing refactor preserves the old null-returning wrappers for any callers not yet on the typed API, so existing behaviour is unchanged. The About screen toggle correctly defers rendering until the stored preference is loaded. No data is written to external services and no auth credentials are involved.

Files Needing Attention: No files require special attention. android-release-feed.ts has a minor edge case in its catch block noted in the inline comment.

Important Files Changed

Filename Overview
mobile/src/updates/android-release-feed.ts New module fetching latest Android release from GitHub's matching-refs API. Well-designed with timeout, pagination, and silent-failure semantics; one edge case where accumulated results from completed pages are discarded on timeout mid-pagination.
mobile/src/updates/use-app-update-check.ts React hook orchestrating the update check: loads preferences, runs shouldCheckForUpdate, fetches the feed, calls evaluateUpdate, and surfaces a prompt. Correctly uses disposed flag and re-reads storage state in dismiss to avoid stale closure issues.
mobile/src/updates/app-update-check.ts Pure logic for shouldCheckForUpdate and evaluateUpdate. Correctly handles 24h throttle, clock regression, platform guard, and per-version dismissal. Well-tested.
mobile/src/updates/update-check-store.ts AsyncStorage wrapper for update check state. Defensive parsing and silent error handling are appropriate for a non-critical preference store.
mobile/src/transport/pairing.ts Refactored to return typed PairingParseResult/PairingRejection. Version check before schema validation cleanly separates out-of-date app from malformed input. Old null-returning wrappers preserved for callers not yet migrated.
mobile/src/transport/pairing-rejection-message.ts Maps PairingRejection reason + input source to actionable user messages. The unsupported-version case correctly identifies which side needs updating based on version comparison direction.
mobile/app/about.tsx Adds Android-only update check toggle. Properly initializes state to null and conditionally renders the Switch only once the stored value is known.
mobile/src/components/UpdateAvailableDrawer.tsx New drawer component presenting the update prompt. Simple and correct; opens GitHub release URL on Get the APK and calls onDismiss in both paths.
mobile/src/storage/preferences.ts Adds loadAutomaticUpdateCheckEnabled/saveAutomaticUpdateCheckEnabled. Silent error handling matches existing preference patterns.
mobile/app/_layout.tsx Wires useAppUpdateCheck into the root layout and renders UpdateAvailableDrawer at the top level.

Sequence Diagram

sequenceDiagram
    participant App as RootLayout (mount)
    participant Hook as useAppUpdateCheck
    participant Prefs as AsyncStorage
    participant GH as api.github.com
    participant Store as update-check-store

    App->>Hook: mount (useEffect)
    Hook->>Prefs: loadAutomaticUpdateCheckEnabled()
    Hook->>Store: loadUpdateCheckState()
    Prefs-->>Hook: enabled (bool)
    Store-->>Hook: "{ lastCheckedAtMs?, dismissedVersion? }"
    Hook->>Hook: shouldCheckForUpdate(platform, enabled, state, now)
    alt skip (iOS / disabled / checked recently)
        Hook-->>App: "prompt = null"
    else check
        Hook->>GH: GET matching-refs/tags/mobile-android-v (paginated)
        GH-->>Hook: "AndroidRelease | null"
        Hook->>Store: "saveUpdateCheckState({ lastCheckedAtMs })"
        Hook->>Hook: evaluateUpdate(currentVersion, release, dismissedVersion)
        alt update-available
            Hook-->>App: "prompt = { release, currentVersion }"
            App->>App: UpdateAvailableDrawer visible
            App->>Hook: dismiss()
            Hook->>Store: "saveUpdateCheckState({ dismissedVersion })"
        else up-to-date / dismissed
            Hook-->>App: "prompt = null"
        end
    end
Loading

Reviews (2): Last reviewed commit: "fix(mobile): address review on pairing m..." | Re-trigger Greptile

Comment thread mobile/app/about.tsx Resolved
@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

The PR adds structured pairing parsers and source-specific rejection messages for QR, pasted, and deep-link inputs. It adds Android release discovery, version comparison, update-check policy, persisted check state, and automatic-update preferences. The root layout now displays an update drawer with release details and APK actions. The About screen exposes the Android update preference. Tests cover pairing failures, release fetching, update decisions, and preference persistence.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 8e8db

Android screen-reader users may encounter the update preference switch without knowing what setting it controls. Add an accessible name before merge.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed and relevant, but it does not follow the required template. It omits the required linked issue, required template headings, completed checklist items, and visual proof for … Add the required template sections and headings. Provide a valid linked issue after “Fixes #”. Attach before-and-after screenshots or a video for the UI changes. Complete the Testing, Review, Agent skill upstream boundary, Notes, and Checkl…
Docstring Coverage ⚠️ Warning Docstring coverage is 26.47% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 34 functions across 14 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: notifying Android users when their mobile build is outdated. It is concise and specific.
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.
Full details: Description check

Explanation

The description is detailed and relevant, but it does not follow the required template. It omits the required linked issue, required template headings, completed checklist items, and visual proof for the new drawer and About toggle.

Resolution

Add the required template sections and headings. Provide a valid linked issue after “Fixes #”. Attach before-and-after screenshots or a video for the UI changes. Complete the Testing, Review, Agent skill upstream boundary, Notes, and Checklist sections, including the build status and manual testing details.

  • Fix all pre-merge checks with AI

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
mobile/src/updates/use-app-update-check.ts (1)

68-78: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Move the persistence side effect out of the setPrompt updater.

State updater functions must be pure. React double-invokes updater functions in development Strict Mode, so this async loadUpdateCheckState/ saveUpdateCheckState side effect can run twice. The updater also depends on loadUpdateCheckState without it being a dependency of dismiss.

Read prompt directly, add it to the dependency array, and call setPrompt(null) after scheduling the persistence update.

♻️ Proposed fix to keep the updater pure
   const dismiss = useCallback(() => {
-    setPrompt((current) => {
-      if (current) {
-        void (async () => {
-          const state = await loadUpdateCheckState()
-          await saveUpdateCheckState({ ...state, dismissedVersion: current.release.version })
-        })()
-      }
-      return null
-    })
-  }, [])
+    if (prompt) {
+      const dismissedVersion = prompt.release.version
+      void (async () => {
+        const state = await loadUpdateCheckState()
+        await saveUpdateCheckState({ ...state, dismissedVersion })
+      })()
+    }
+    setPrompt(null)
+  }, [prompt])

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 99d13e2d-dff1-487d-ae00-4b833f8eed8b

📥 Commits

Reviewing files that changed from the base of the PR and between 5e258a9 and 171a6af.

📒 Files selected for processing (18)
  • mobile/app/_layout.tsx
  • mobile/app/about.tsx
  • mobile/app/pair-scan.tsx
  • mobile/src/components/UpdateAvailableDrawer.tsx
  • mobile/src/storage/preferences.test.ts
  • mobile/src/storage/preferences.ts
  • mobile/src/transport/pair-confirm-state.test.ts
  • mobile/src/transport/pair-confirm-state.ts
  • mobile/src/transport/pairing-rejection-message.ts
  • mobile/src/transport/pairing.test.ts
  • mobile/src/transport/pairing.ts
  • mobile/src/transport/types.ts
  • mobile/src/updates/android-release-feed.test.ts
  • mobile/src/updates/android-release-feed.ts
  • mobile/src/updates/app-update-check.test.ts
  • mobile/src/updates/app-update-check.ts
  • mobile/src/updates/update-check-store.ts
  • mobile/src/updates/use-app-update-check.ts

Comment thread mobile/src/storage/preferences.ts Resolved
Comment on lines +1 to +9
import { PAIRING_OFFER_VERSION, PairingOfferSchema, type PairingOffer } from './types'

// Why: this file mirrors src/shared/pairing.ts (which is covered by CI
// vitest) but uses atob/btoa because Metro/Hermes don't ship Node's
// Buffer. Keep the parsing semantics in sync — when one changes, update
// the other.
// the other. The rejection reasons below are mobile-only and add no
// accept/reject difference: they explain a refusal the shared copy states
// as null.

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Locate the shared pairing parser and compare its accept/reject logic to mobile/src/transport/pairing.ts.
fd -HI 'pairing.ts' src/shared
cat -n src/shared/pairing.ts 2>/dev/null

Repository: stablyai/orca

Length of output: 3916


🏁 Script executed:

#!/bin/bash
# Description: Inspect the updated mobile pairing parser implementation around the cited functions.
cat -n mobile/src/transport/pairing.ts | sed -n '1,180p'

Repository: stablyai/orca

Length of output: 6495


Synchronize src/shared/pairing.ts route and version handling.

Mobile now rejects non-orca://pair routes before decoding and rejects unsupported v versions before schema parsing. src/shared/pairing.ts only rejects non-pair hostnames inside extractPairingCodeFromUrl and parses through PairingOfferSchema.parse in both decoded paths. Apply the same matchPairRouteRest-style route check and pre-schema v rejection in the shared parser so both sides make the same accept/reject decisions.

- The unsupported-version message always told the user to update their phone.
  That is only right when the offer is newer; an older offer means the desktop
  is behind, and pointing at the wrong machine is worse than saying nothing.
- saveAutomaticUpdateCheckEnabled is called without await from About, so a
  failing write became an unhandled rejection. Swallow it like the other writes.
- The About toggle rendered default-on before the stored value loaded, flashing
  ON for opted-out users and letting a quick tap be reverted by the load.
- Update-check storage key now follows the 'orca:camelCaseKey' convention.

Adds a parity test pinning the mobile parser's accept/reject set to the shared
one across 29 inputs, including the one pre-existing divergence (mobile matches
the scheme and host case-insensitively for QR alphanumeric mode).
@AboveColin

Copy link
Copy Markdown
Author

Thanks both — four of five points were right and are fixed in 78dcbeb. The fifth I measured, and it does not hold.

Fixed

  • Version message blamed the phone in both directions (@coderabbitai, Major) — real bug, and the worst kind here since the whole point of the message is naming which side is behind. Now direction-aware: an older offer says "Update Orca on your computer". Test covers both directions.
  • saveAutomaticUpdateCheckEnabled missing try/catch (@coderabbitai) — correct, About calls it with void, so a failing write was an unhandled rejection. Swallowed like the neighbouring writes.
  • Toggle initialized before the async load (@greptile-apps) — correct on both counts, the flash and the tap-then-revert race. Now boolean | null, rendered only once the value is known, so no tap can land before the load resolves.
  • Storage key convention (@greptile-apps) — renamed to orca:updateCheckState.

Not reproduced: shared/mobile parser divergence

@coderabbitai asked to apply the route check and pre-schema v rejection to src/shared/pairing.ts so both sides make the same decisions. They already do. The new checks are reason-reporting, not new refusals: the shared copy's extractPairingCodeFromUrl already rejected non-pair hosts, and PairingOfferSchema already rejected a wrong v — reading the version first only changes which message the user gets, not whether the offer is accepted.

Rather than assert that, I ran both parsers over 29 inputs (valid URL, bare code, hash form, wrong route, extra path, truncated code, junk base64, wrong v, missing fields, wrong types, non-object payloads). They agree on every one except a single case:

ORCA://PAIR?code=…    mobile: accepted    shared: rejected

That one pre-dates this PR: main's mobile parser already matched with /i and shipped a test for it (QR alphanumeric mode encodes uppercase), while the shared copy compares URL.hostname case-sensitively. So it is a real inconsistency, but not one this PR introduces, and mobile is arguably the correct side. I have pinned all of it in pairing-shared-parity.test.ts so the accept/reject sets stay locked together and that gap stays visible instead of being forgotten. Fixing the shared/web copy felt out of scope here — happy to do it in a follow-up if you'd rather.

Not addressed: docstring coverage

Deliberate. AGENTS.md requires concise, non-obvious comments only ("DO NOT be verbose, explain the obvious"). Writing docstrings to reach an 80% ratio would contradict the repo's own style rule, so I would rather leave the threshold unmet than the guideline broken.

PR description now follows the template.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@AboveColin Thanks for the detailed validation.

The direction-aware version message and the handled preference write address the valid findings.

I withdraw the shared/mobile parser-divergence finding. The new parsing branches change rejection reporting, not acceptance. The parity test also records the pre-existing uppercase-host difference.

I also withdraw the docstring-coverage finding. The AGENTS.md guidance takes precedence over an arbitrary documentation ratio.

🐇 ✓


✏️ Learnings added
Learnt from: AboveColin
URL: https://github.com/stablyai/orca/pull/11825

Timestamp: 2026-08-01T06:15:22.978Z
Learning: In this repository, `AGENTS.md` requires concise comments only for non-obvious behavior. Do not request docstrings solely to satisfy a documentation-coverage ratio when that request conflicts with this rule.

Learnt from: AboveColin
URL: https://github.com/stablyai/orca/pull/11825

Timestamp: 2026-08-01T06:15:22.978Z
Learning: For pairing parsing, the mobile and shared parsers have matching accept/reject behavior for the PR's route and unsupported-version changes. Mobile accepts uppercase `ORCA://PAIR` hosts for QR alphanumeric compatibility, while the shared parser rejects them due to a pre-existing case-sensitive hostname check; `pairing-shared-parity.test.ts` records this intentional visible difference.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b094274-fcb0-47ef-bcdf-1c87b41eb29f

📥 Commits

Reviewing files that changed from the base of the PR and between 171a6af and 78dcbeb.

📒 Files selected for processing (6)
  • mobile/app/about.tsx
  • mobile/src/storage/preferences.ts
  • mobile/src/transport/pairing-rejection-message.test.ts
  • mobile/src/transport/pairing-rejection-message.ts
  • mobile/src/transport/pairing-shared-parity.test.ts
  • mobile/src/updates/update-check-store.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • mobile/src/updates/update-check-store.ts
  • mobile/app/about.tsx
  • mobile/src/storage/preferences.ts

Comment on lines +24 to +26
// Why: a newer offer means this app is behind; an older one means the
// desktop is. Naming the wrong side sends the user to update a machine
// that is already current.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Shorten or remove the multi-line comments.

The code and test names already state the behavior. Keep only a single line when non-obvious context is necessary.

  • mobile/src/transport/pairing-rejection-message.ts#L24-L26: remove the implementation walkthrough or replace it with one concise rationale.
  • mobile/src/transport/pairing-rejection-message.test.ts#L5-L6: remove the rationale because the test name is sufficient.
  • mobile/src/transport/pairing-shared-parity.test.ts#L6-L8: reduce the mirror-contract explanation to one line.
  • mobile/src/transport/pairing-shared-parity.test.ts#L73-L76: reduce the divergence explanation to one line.

As per coding guidelines, comments must be concise, limited to non-obvious information, and preferably one line.

📍 Affects 3 files
  • mobile/src/transport/pairing-rejection-message.ts#L24-L26 (this comment)
  • mobile/src/transport/pairing-rejection-message.test.ts#L5-L6
  • mobile/src/transport/pairing-shared-parity.test.ts#L6-L8
  • mobile/src/transport/pairing-shared-parity.test.ts#L73-L76

Source: Coding guidelines

@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown

All four fixes look correct in 78dcbeb:

  • Direction-aware message: offerVersion > supportedVersion correctly routes "Update Orca on your phone" vs "on your computer". The test in pairing-rejection-message.test.ts covers both directions.
  • saveAutomaticUpdateCheckEnabled try/catch: Wrapped in preferences.ts with a comment explaining why (unawaited call from About, so the rejection must be swallowed there rather than bubble up). Good.
  • Toggle race: useState<boolean | null>(null) + updateCheckEnabled !== null gate is the right fix. The disposed flag in the effect cleanup also prevents a stale-closure set after unmount.
  • Storage key: orca:automaticUpdateCheckEnabled in preferences.ts and orca:updateCheckState in update-check-store.ts — both follow the convention now.

On the parser divergence: the parity test is the right call. Pinning the uppercase case as a documented, named divergence (documents the one known divergence: uppercase scheme and host) is better than silently closing the gap in a PR where that change isn't the subject. The test will fail visibly if either side drifts, which is what matters.

No further concerns.

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 0ec46f3b-61f7-4f07-8462-28ab97825b62

📥 Commits

Reviewing files that changed from the base of the PR and between 78dcbeb and 8e8db0b.

📒 Files selected for processing (5)
  • mobile/app/_layout.tsx
  • mobile/app/about.tsx
  • mobile/app/pair-scan.tsx
  • mobile/src/settings/about-screen.tsx
  • mobile/src/transport/types.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Comment thread mobile/app/about.tsx
<View style={styles.updateSection}>
<View style={styles.row}>
<Text style={styles.rowLabel}>Check for updates</Text>
<Switch

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🤖 get_repo_knowledge executed:

get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions

Length of output: 39498


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- mobile/app/about.tsx ---'
sed -n '1,130p' mobile/app/about.tsx
printf '%s\n' '--- related accessibility and switch usage ---'
rg -n -S --glob '*.{tsx,ts,js,jsx}' 'accessibility(Label|LabelledBy)|<Switch|Switch' mobile | head -200

Repository: stablyai/orca

Length of output: 26698


🏁 Script executed:

#!/bin/bash
set -eu
sed -n '1,130p' mobile/app/about.tsx
printf '\n--- switch/accessibility references ---\n'
rg -n -S --glob '*.{tsx,ts,js,jsx}' 'accessibility(Label|LabelledBy)|<Switch|Switch' mobile | head -200

Repository: stablyai/orca

Length of output: 25504


🌐 Web query:

site:reactnative.dev/docs/0.78 accessibilityLabelledBy Switch accessibilityLabel React Native Android

💡 Result:

In React Native, the Switch component inherits View props [1], and since the View component supports accessibilityLabelledBy [2][3], the Switch component can technically accept this prop. accessibilityLabelledBy allows you to associate a component with another element's nativeID to provide an accessible label for screen readers [2]. This is useful for complex forms where you want the screen reader to announce a label associated with the control [2]. To use this with a Switch on Android: 1. Assign a unique nativeID to the Text component serving as the label. 2. Pass that nativeID as the string value to the accessibilityLabelledBy prop on the Switch. Example: Enable Notifications When the Switch is focused by a screen reader (such as TalkBack on Android), it will announce the Switch's state along with the text provided by the element referenced by the nativeID [2]. Ensure that your implementation testing on Android accounts for specific OS versions, as accessibility behavior can vary across different TalkBack releases.

Citations:


Add an accessible name to the update switch.

The Android Switch has no accessibilityLabel or accessibilityLabelledBy association. The neighboring Text does not label it automatically, so TalkBack users can reach the switch without its setting name. Add accessibilityLabel="Check for updates".

Proposed fix
 <Switch
+  accessibilityLabel="Check for updates"
   value={updateCheckEnabled}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Switch
<Switch
accessibilityLabel="Check for updates"

@AboveColin

Copy link
Copy Markdown
Author

Closing this. It has fallen behind main and I'm not able to keep it current. Thanks for the reviews.

@AboveColin AboveColin closed this Nov 15, 2026
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.

4 participants