Skip to content

chore(mobile): App Store prep — privacy manifest, debug-log cleanup, and protocol-version compat block - #1440

Merged
Jinwoo-H merged 5 commits into
mainfrom
Jinwoo-H/mobile-app-store-prep
May 6, 2026
Merged

Jinwoo-H merged 5 commits into
mainfrom
Jinwoo-H/mobile-app-store-prep

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Three small pre-submission changes for the eventual public iOS App Store release of Orca Mobile.

1. iOS privacy manifest (mobile/app.json)

Declare an iOS privacy manifest via Expo's ios.privacyManifests config. On npx expo prebuild Expo merges our declarations with the SDK packages' bundled manifests and writes mobile/ios/Orca/PrivacyInfo.xcprivacy. Apple has required this since May 2024 and rejects builds without it.

Required-reason API categories declared:

  • NSPrivacyAccessedAPICategoryUserDefaults (CA92.1) — AsyncStorage and React Native UserDefaults reads, all inside the app's own container.
  • NSPrivacyAccessedAPICategoryFileTimestamp (C617.1) — RN core's file-mtime reads in cache-invalidation paths.
  • NSPrivacyAccessedAPICategorySystemBootTime (35F9.1) — boost's monotonic-clock initialization.

NSPrivacyTracking is false. NSPrivacyTrackingDomains and NSPrivacyCollectedDataTypes are empty — verified against mobile/package.json which has no analytics, crash reporting, or tracking SDKs.

After running npx expo prebuild --platform ios --no-install Expo CNG produced a comprehensive PrivacyInfo.xcprivacy covering the four categories above (UserDefaults, FileTimestamp, SystemBootTime) plus DiskSpace contributed by Expo SDK packages.

2. Remove [mobile-fit] debug logs (mobile/app/.../[worktreeId].tsx, src/main/runtime/orca-runtime.ts)

Removed all 9 [mobile-fit] console.log calls left over from the presence-lock / scrollback-hydration debugging sessions (8 in the mobile session screen, 1 in orca-runtime). They were never gated behind __DEV__ and would run in shipped App Store builds. Strings only contained opaque handles and viewport dims (no PII or tokens), but no reason to keep verbose diagnostics in user-facing builds.

3. Protocol-version compat block on status.get

Mobile users always lag behind desktop releases because the App Store adds 24-48h to mobile updates. Desktop ships instantly via GitHub. The asymmetry is permanent. Today the app already handles routine drift silently — RPC responses parse permissively (JSON.parse + as casts, no strict zod on the wire path), event-type switches are if/else if chains that no-op on unknowns, and terminal.updateViewport already falls back to the legacy resubscribe path on "method not found". So additive desktop changes don't break old mobiles.

What we didn't have was a way to declare "this combo is incompatible — do not pretend it works." This adds that, framed as App Store prep so a future genuinely-breaking change has a clean way to surface itself.

Wire format. Extends the existing status.get RPC (no new method) to return two new optional fields on RuntimeStatus:

  • protocolVersion — desktop's pairing protocol version.
  • minCompatibleMobileVersion — minimum mobile version this desktop accepts (kill-switch slot).

Both optional so pre-PR desktops keep working. Mobile treats absence as 0.

Constants. Two integers each side, in src/shared/protocol-version.ts (desktop) and mobile/src/transport/protocol-version.ts (mobile). Mobile's file isn't shared because Metro/Expo doesn't resolve outside mobile/; the values are intentionally low-churn so manual sync is acceptable. Both files include inline bump-discipline comments (do bump for: removed RPC / changed semantics / changed encryption; do not bump for: new RPCs / new optional fields / new event types).

Today's values. All four constants set to 1/0 so evaluateCompat always returns { kind: 'ok' }. Nothing actually blocks. The wire format is in place to flip a switch when needed.

UI. mobile/src/components/ProtocolBlockScreen.tsx renders only when verdict is blocked. Two variants:

Both include "Pair a different host" routing back to the host list. No persistent banners, no soft warnings, no middle states — only "works" or "blocked with a concrete action."

Wiring. mobile/app/h/[hostId]/index.tsx adds a useEffect keyed on connState === 'connected' that calls status.get, runs evaluateCompat, sets local state, and console.warns on a blocked verdict for support debugging. Mirrors the existing worktree.ps pattern in the same file (gates on response.ok, narrows via RpcSuccess, no-op on transient errors).

Out of scope (intentional). Persistent soft-warning banner, per-method capability negotiation, server-driven feature flags, docs/mobile-protocol-changelog.md, CI check enforcing changelog entries on bumps. The first three were rejected during design review (auto-design-review-fix skill, 3 iterations) as either "information without action" UX or unjustified scope. The last two can land when the bump cadence outpaces what two integers in two files can clearly track.

Test plan

  • pnpm lint clean (6 unrelated warnings in github-project/ from PR [feat] Add a full Github project view under "Tasks" #1424)
  • pnpm tc:node clean
  • pnpm tc:web clean
  • Mobile: tsc --noEmit and oxlint clean
  • pnpm test mobile/src/transport/protocol-compat.test.ts — 7/7 pass (table-driven: undefined fields, equal versions, newer desktop, mobile-too-old, undefined coerced to 0, kill-switch precedence, today's wide-open behavior)
  • pnpm test src/main/runtime/orca-runtime.test.ts -t "protocol version" — new assertion that getStatus() returns the version fields passes
  • pnpm vitest run src/main/runtime/mobile-presence-lock.test.ts src/main/runtime/mobile-subscribe-integration.test.ts src/main/runtime/fit-override-integration.test.ts — 39/39 pass (unchanged)
  • Privacy manifest verified by re-running npx expo prebuild --platform ios --no-install and inspecting the generated mobile/ios/Orca/PrivacyInfo.xcprivacy.

Manual validation for the compat-block path

Today both compat constants are 0 so the screen never renders. To exercise it:

  1. Set MIN_COMPATIBLE_DESKTOP_VERSION = 999 in mobile/src/transport/protocol-version.ts.
  2. Rebuild mobile, pair to any current desktop.
  3. Host detail screen should render the "Update Orca desktop" block screen with the GitHub Releases button.
  4. Revert the constant before merging.

Made with Orca 🐋

@Jinwoo-H Jinwoo-H changed the title chore(mobile): App Store prep — privacy manifest and remove debug logs chore(mobile): App Store prep — privacy manifest, debug-log cleanup, and protocol-version compat block May 5, 2026
Jinwoo-H and others added 3 commits May 5, 2026 22:04
Two small pre-submission changes for the eventual public iOS App Store
release of Orca Mobile:

1. mobile/app.json — declare an iOS privacy manifest via the
   expo.ios.privacyManifests field. On 'npx expo prebuild' Expo merges
   our declarations with the SDK packages' bundled manifests and
   writes mobile/ios/Orca/PrivacyInfo.xcprivacy. Apple has required
   this since May 2024 and rejects builds without it.

   Required-reason API categories declared:
   - NSPrivacyAccessedAPICategoryUserDefaults (CA92.1) — AsyncStorage
     and React Native UserDefaults reads, all inside the app's own
     container.
   - NSPrivacyAccessedAPICategoryFileTimestamp (C617.1) — RN core's
     file-mtime reads in cache-invalidation paths.
   - NSPrivacyAccessedAPICategorySystemBootTime (35F9.1) — boost's
     monotonic-clock initialization.

   NSPrivacyTracking is false. NSPrivacyTrackingDomains and
   NSPrivacyCollectedDataTypes are empty — verified against
   mobile/package.json which has no analytics, crash reporting, or
   tracking SDKs.

2. Removed all 9 [mobile-fit] console.log calls left over from the
   presence-lock / scrollback-hydration debugging sessions (8 in
   mobile/app/h/[hostId]/session/[worktreeId].tsx, 1 in
   src/main/runtime/orca-runtime.ts). They were never gated behind
   __DEV__ and would run in shipped App Store builds. Strings only
   contained opaque handles and viewport dims, no PII or tokens —
   but no reason to keep verbose diagnostics in user-facing builds.

Tests: presence-lock + mobile-subscribe-integration + fit-override-
integration all green (39/39). Lint, tc:node, tc:web clean.

Co-authored-by: Orca <[email protected]>
Extends status.get to return protocolVersion + minCompatibleMobileVersion.
Mobile reads them on connect, evaluates compat, and renders a hard-block
screen when a combo is declared incompatible. Today's compat constants are
wide-open (mobile=any, desktop=any) so nothing actually blocks; the wire
format is in place for the day we ship a genuinely-breaking change.

Routine drift (additive desktop changes) stays handled by mobile's existing
permissive parsing and per-method fallbacks.

Co-authored-by: Orca <[email protected]>
CI was failing two ways:
1. Mobile tsc picked up a test file importing vitest, which isn't a
   mobile devDependency. Exclude *.test.ts from mobile/tsconfig.json.
2. Root vitest can't include mobile/src/** because vite's auto-tsconfig
   discovery chokes on mobile/tsconfig.json's 'expo/tsconfig.base'
   extends path (expo isn't installed at the repo root). Revert the
   include and instead duplicate the pure evaluator into
   src/shared/protocol-compat.ts (canonical, tested) with a same-shape
   copy in mobile/src/transport/protocol-compat.ts (Metro-reachable).

Both copies have identical logic; the mobile copy carries a comment
pointing to the tested canonical version.

Co-authored-by: Orca <[email protected]>
@Jinwoo-H
Jinwoo-H force-pushed the Jinwoo-H/mobile-app-store-prep branch from 753f78b to 9ab10fc Compare May 6, 2026 02:07
Jinwoo-H and others added 2 commits May 5, 2026 22:14
…-progress pairs

The 5s CONNECT_TIMEOUT_MS added in #1481 was a speculative band-aid for
'WS sometimes never fires onopen' — but in practice it was force-closing
perfectly fine connections that hadn't completed by 5s (notably first-time
QR pairing on iOS, where Local Network permission prompt blocks the WS open
for several seconds).

Worse, the force-close transitioned state to 'reconnecting' (not
'disconnected'), so waitForConnected() never rejected and sendRequest()
hung. Combined with reconnect re-firing the timer, the result was an
infinite 'Connecting…' loop with no surfaced error.

Pair flows hit this hardest because they call connect() directly without
the shared RpcClientProvider, so there's no UI state listener to even show
'reconnecting' to the user — just the spinner.

Removing the timer entirely. The handshake-timeout (5s, post-onopen) still
catches genuinely stuck handshakes. If we hit a real 'never fires onopen'
case later, we can revisit with proper instrumentation rather than a
guess at the symptom.

Co-authored-by: Orca <[email protected]>
@Jinwoo-H
Jinwoo-H merged commit 63e36d0 into main May 6, 2026
3 checks passed
brennanb2025 added a commit that referenced this pull request Jul 22, 2026
…ed (#9780)

* feat(mobile): mount ProtocolBlockScreen when protocol compat is blocked

ProtocolBlockScreen existed since PR #1440 but was never mounted: on a
'blocked' compat verdict the only output was a console.warn, so a future
MIN_COMPATIBLE_RUNTIME_CLIENT_VERSION bump would have silently shown a
broken host UI instead of the update screen.

Add HostProtocolGate — a choke point in app/h/_layout.tsx above every
/h/[hostId] route — that consumes useHostStatusGates and replaces the
blocked host's entire UI (sidebar + detail stack) with ProtocolBlockScreen.
The host list and other hosts stay usable; the screen's own 'Back to
hosts' escape hatch routes to '/'. Both block reasons render their
respective CTAs (mobile-too-old → App Store, desktop-too-old → GitHub
Releases). Compat logic stays in the src/shared mirror contract — no fork.

* fix(mobile): fence incompatible host routes efficiently

* fix(mobile): route Android updates to releases
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ed (stablyai#9780)

* feat(mobile): mount ProtocolBlockScreen when protocol compat is blocked

ProtocolBlockScreen existed since PR stablyai#1440 but was never mounted: on a
'blocked' compat verdict the only output was a console.warn, so a future
MIN_COMPATIBLE_RUNTIME_CLIENT_VERSION bump would have silently shown a
broken host UI instead of the update screen.

Add HostProtocolGate — a choke point in app/h/_layout.tsx above every
/h/[hostId] route — that consumes useHostStatusGates and replaces the
blocked host's entire UI (sidebar + detail stack) with ProtocolBlockScreen.
The host list and other hosts stay usable; the screen's own 'Back to
hosts' escape hatch routes to '/'. Both block reasons render their
respective CTAs (mobile-too-old → App Store, desktop-too-old → GitHub
Releases). Compat logic stays in the src/shared mirror contract — no fork.

* fix(mobile): fence incompatible host routes efficiently

* fix(mobile): route Android updates to releases
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