Skip to content

feat(mobile): receive native push notifications from paired desktops - #19951

Merged
Jinwoo-H merged 7 commits into
mainfrom
feat/mobile-push-mobile
Sep 11, 2026
Merged

Jinwoo-H merged 7 commits into
mainfrom
feat/mobile-push-mobile

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 39 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2916 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2093 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​823
Prod 65 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3117 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2200 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​917

Paired phones can receive agent notifications while Orca is closed. Explicit mobile consent registers the native APNs/FCM token through the paired desktop and the already-landed push gateway. This is the final mobile portion of #19204, following merged cloud #19912 and desktop #19935.

  • Provider push is the sole OS-banner path; socket traffic reconciles dismissed notifications. Removes the old socket scheduling/replay implementation.
  • Alert categories always mirror the desktop. Mobile controls sound, suppression while viewing a workspace, and the default three-minute desktop-away policy. Registration pauses after seven days without mobile use and reconnection.
  • Notification taps resolve the paired host and workspace. Live, background and reconnect dismissals preserve per-notification host/epoch/sequence identity; iOS handles silent dismissal natively.
  • Keeps main's reusable settings screen, routes consent through one owner, adds Android status-bar artwork and production iOS push entitlements.
  • Fixes Expo's cached rejected native-token promise with a narrow dependency patch. Removes the arbitrary 512-entry eviction so live dismissal fences survive busy/multi-host sessions; retention remains 24 hours.

New mobile requires a push-capable desktop for phone banners. Older desktops remain usable, but the new mobile app does not fall back to socket-created OS notifications. Settings explain when an updated desktop is needed. Pairing alone does not opt in; the enable control discloses Orca's push service.

Validation: mobile frozen install, typecheck, lint and formatting pass; 542 test files / 4,357 tests pass (3 skipped), plus three new settings tests. Native Swift checks pass for restart, sequence/host isolation, expiry and more than 512 dismissals. Signed iOS simulator and physical-device builds succeed; Android production bundle export succeeds. On the fresh simulator build, injected remote pushes create two native tray entries; dismissal removes only the older sequence, preserves the newer alert, and remains effective after app restart without suppressing another host. Settings render correctly with enabled controls and with all three controls visible but greyed out when disabled. Fresh physical APNs delivery remains unverified: iPad installation is blocked by the locked device (CoreDevice 10003). Simulator injection does not prove APNs background wakeup. Physical Android testing is deferred. The pane-routing follow-up includes a gateway payload change, deployed through the push-only production workflow; no Terraform changes.

Changed-line breakdown (additions / deletions):

Category Added Removed
Tests 2,763 2,025
Implementation, including dependency patch 1,689 932
Lockfile 1,230 1,232
Docs/config/workflows 111 2

Lockfile churn comes from regeneration with the repository's pinned pnpm 12, including peer-context keys. The new runtime dependency is expo-task-manager; existing dependency versions are retained.

Notification-tap correction: preserve the desktop's optional paneKey through the gateway's APNs/FCM payload and mobile route. Once the workspace tabs load, select the originating terminal/split pane through the existing mobile tab action; closed panes keep normal workspace selection. This adds a small desktop/cloud follow-up to the mobile PR. The gateway must be deployed before using the updated desktop because the send schema rejects unknown fields. Existing workspace-only notifications remain valid.

Validation for this correction: full mobile suite 544 files / 4,365 tests passed (3 skipped), desktop fan-out/dispatcher 17 tests passed, gateway 139 tests passed (4 skipped); mobile, desktop-node, and gateway typechecks passed. Standalone Android build succeeded. Gateway deployment succeeded (Actions run 34556955227); authenticated production schema probe accepted paneKey. The standalone Orca Notification Android APK is installed on the connected Samsung. The matching desktop ad hoc build is publishing in run 34557053665. A real provider-delivered tap with the newly built desktop has not yet been exercised.

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

Important

One iOS-only dismissal race: the overtaking-write guard in wasPushDismissed never observes writes made by the native PushDismissalLedger (the silent-push subscriber writes it directly), so a foreground alert decided concurrently with its dismissal can show and persist after the dismissal. Narrow, but it is a documented guarantee this code does not uphold on the platform where it matters most.

Reviewed changes

  • Provider-push delivery — replaces the old socket-scheduled local notifications (deleted local-notification-scheduling.ts / notification-reconnect-catchup.ts) with native APNs/FCM delivery through the already-landed gateway; socket traffic now only reconciles dismissals.
  • Registration & consent — push-registration.ts becomes the single consent owner, probing each host for notifications.remote-push.v1, registering the native token per paired host, and persisting a registered / pendingUnregister outbox in AsyncStorage.
  • Dismissal fencing — per-host/epoch/notificationId sequence watermarks in JS (push-dismissal-watermarks.ts) and a native iOS PushDismissalLedger, with socket, provider-dismiss, background-task, and reconnect-reconciliation dismissal surfaces.
  • Settings & onboarding — reuses the shared NotificationsScreen with phone-only delivery controls (onlyWhenDesktopAway, sound, suppressWhileViewing); onboarding routes consent through setRemotePushEnabled.
  • Build config — app.config.js derives the iOS aps-environment entitlement from ORCA_IOS_APS_ENVIRONMENT so production entitlements match the production token; adds the expo-notifications patch, google-services.json, and the native dismissal module.

The core sequencing invariants (monotonicity, host/epoch/id isolation, boundary semantics) all check out across the three dismissal surfaces, and the mobile↔desktop fingerprint derivation matches deriveRelayHostId exactly. The registration state machine, consent-generation races, and host-removal restore path are handled carefully and well tested.

ℹ️ Nitpicks

  • The dismissal ledger (JS AsyncStorage and, more relevantly, the iOS UserDefaults single JSON blob) has no count cap inside its 24h retention, and notificationId is admitted up to 2048 chars. A busy multi-host session could inflate the UserDefaults value well past what that store is meant to hold and rewrite frequently; a high count cap (well above the removed 512) or a tighter notificationId bound would keep the worst case sane.
  • use-remote-push-capable-hosts.ts resolved can settle on "Pair an updated desktop" when a host that never answered its capability probe disconnects while another host has already answered "no push" — the disconnected host's support is silently dropped. Minor UX edge case, since a reconnect re-probes.

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

const precedingWrites = writes
await precedingWrites
const dismissed = await readDismissal(payload, key)
if (dismissed || writes === precedingWrites) {

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.

On iOS this overtaking-write guard never fires for the dismiss path that actually writes the ledger. OrcaNotificationDismissalSubscriber calls PushDismissalLedger.shared.remember directly on a silent dismiss push, bypassing the JS writes chain, so writes === precedingWrites always holds and a negative snapshot taken mid-dismiss is returned as-is — the foreground banner shows and persists until a later reconnect reconciliation catches it. The dedicated race test only drives a JS-queued native write, so this direct-write path is uncovered.

Technical details
# iOS dismissal re-queue gap

## Affected sites
- mobile/src/notifications/push-dismissal-watermarks.ts:96-103 — `wasPushDismissed` re-checks only when `writes !== precedingWrites`, i.e. only for writes queued through `queueDismissalOperation` (JS `rememberPushDismissal`).
- mobile/modules/orca-notification-dismissal/ios/OrcaNotificationDismissalSubscriber.swift:13 — the silent-dismiss handler writes `PushDismissalLedger.shared.remember(fence)` directly, never advancing the JS `writes` chain. This is the primary iOS dismiss path.
- mobile/src/notifications/push-receive.ts:73-109 — `shouldSuppressForegroundPush` awaits `wasPushDismissed` as its final gate before showing the banner.

## Required outcome
- A foreground alert whose dismissal lands during the `shouldSuppressForegroundPush` await chain must be suppressed (or, failing that, the race and its residual banner must be acknowledged as accepted behavior with the guarantee comment narrowed).

## Suggested approach (optional)
- Have the native subscriber surface its write to JS (e.g. an emitted event that bumps `writes`), or re-read the native ledger after a microtask/short delay before returning a negative `wasPushDismissed` on iOS, so a mid-decision native write is observed.

## Open questions for the human (optional)
- Is the residual banner (persisting until the next reconnect reconciliation) acceptable for this narrow foreground window, or should it be closed?

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The mobile app now supports remote push registration, foreground filtering, notification routing, dismissal reconciliation, pane-aware navigation, and delivery preferences. The change adds native iOS dismissal storage, Android Firebase configuration, Expo notification setup, push-token renewal, host capability probing, and registration lifecycle handling. It removes local desktop notification scheduling and watermark-based reconnect catch-up. Tests, workflows, and documentation cover the new push behavior.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 07909

Push consent behavior is covered, but a socket-banner regression and some registration test gaps could evade automated validation. These are bounded validation risks rather than a demonstrated user-facing failure.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description gives detailed scope, rationale, testing results, limitations, and linked issue context. However, it does not follow the required template because the required section headings and che… Rewrite the description using all required template sections. Add the linked issue in the required Fixes #... form, provide before/after screenshots or videos for the UI and behavior changes (or write N/A with a reason), complete the Te…
Docstring Coverage ⚠️ Warning Docstring coverage is 11.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 101 functions across 71 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 and concisely describes the main change: native push notifications from paired desktops on mobile.
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 gives detailed scope, rationale, testing results, limitations, and linked issue context. However, it does not follow the required template because the required section headings and checklist are missing, and it provides no Visual Proof attachment or explicit N/A statement for the UI and behavior changes.

Resolution

Rewrite the description using all required template sections. Add the linked issue in the required Fixes #... form, provide before/after screenshots or videos for the UI and behavior changes (or write N/A with a reason), complete the Testing, Review, Agent skill upstream boundary, Notes, and Checklist sections, and add AI disclosure details if applicable.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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: 1

🧹 Nitpick comments (3)
mobile/src/notifications/push-registration-cancellation.test.ts (1)

91-93: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Four settle points in this file use fixed real-timer sleeps instead of a condition-bounded wait. The shared root cause is that await new Promise((resolve) => setTimeout(resolve, n)) guesses how long the reconcile chain takes. A guessed duration that is too short fails a positive assertion on slow CI, and a guessed duration that is too short before a negative assertion lets the test pass vacuously. Every other settle point in the same file already uses vi.waitFor.

  • mobile/src/notifications/push-registration-cancellation.test.ts#L91-L93: replace the 10 ms sleep with vi.waitFor wrapping both records() assertions, so the wait ends when cleanup completes.
  • mobile/src/notifications/push-registration-cancellation.test.ts#L104-L107: replace the 10 ms sleep with vi.waitFor on the condition that makes the negative meaningful, for example wait until getDevicePushToken has settled, then assert registerPush was not sent.
  • mobile/src/notifications/push-registration-cancellation.test.ts#L202-L203: drain the reconcile chain to quiescence before asserting sendRequest was not called, or state the one-macrotask assumption in a comment as mobile/src/notifications/push-registration.test.ts Lines 50-54 does.
  • mobile/src/notifications/push-registration-cancellation.test.ts#L224-L225: apply the same drain as the previous site before the not.toHaveBeenCalled() assertion.
mobile/src/notifications/notification-opt-in-gate.test.ts (1)

54-54: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a rejection test for setRemotePushEnabled.

shouldPresentNotificationOptIn() catches rejections from both the adopt and denied paths and returns false. Add a test for a rejected consent write to preserve the startup guarantee.

💚 Proposed additional case
   it('does not block startup when storage or permission checks fail', async () => {
     vi.mocked(readPushNotificationsPreference).mockResolvedValue({ value: null, loaded: false })
     await expect(shouldPresentNotificationOptIn()).resolves.toBe(false)
 
     vi.mocked(readPushNotificationsPreference).mockResolvedValue({ value: null, loaded: true })
     vi.mocked(getNotificationPermissionState).mockRejectedValue(new Error('unavailable'))
     await expect(shouldPresentNotificationOptIn()).resolves.toBe(false)
   })
+
+  it('does not block startup when adopting system authorization fails to persist', async () => {
+    vi.mocked(readPushNotificationsPreference).mockResolvedValue({ value: null, loaded: true })
+    vi.mocked(getNotificationPermissionState).mockResolvedValue({
+      granted: true,
+      status: 'granted',
+      canAskAgain: true,
+      authorizationReflectsUserChoice: true
+    })
+    vi.mocked(setRemotePushEnabled).mockRejectedValue(new Error('consent write failed'))
+
+    await expect(shouldPresentNotificationOptIn()).resolves.toBe(false)
+  })
mobile/src/notifications/push-registration.test.ts (1)

416-419: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Start token sync and invoke its AppState callback instead of attaching twice.

startPushTokenSync() installs the AppState listener that calls reconcileAllHosts() when the app becomes active. This test never starts token sync, so the second attachPushRegistration tests a different trigger. Start token sync, capture its callback, invoke it after setting the state to 'active', and stop the sync after the test.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 29dd422a-6868-48ef-ae75-f1aaf2faee0b

📥 Commits

Reviewing files that changed from the base of the PR and between 74cc9b5 and 431b89d.

⛔ Files ignored due to path filters (2)
  • mobile/assets/notification-icon.png is excluded by !**/*.png
  • mobile/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (85)
  • .github/workflows/mobile-ios-release.yml
  • .github/workflows/mobile.yml
  • docs/site/content/docs/mobile.mdx
  • docs/site/content/docs/notifications.mdx
  • mobile/app.config.js
  • mobile/app.json
  • mobile/app/_layout.tsx
  • mobile/app/mobile-onboarding.tsx
  • mobile/app/notifications.tsx
  • mobile/google-services.json
  • mobile/modules/orca-notification-dismissal/expo-module.config.json
  • mobile/modules/orca-notification-dismissal/ios/OrcaNotificationDismissal.podspec
  • mobile/modules/orca-notification-dismissal/ios/OrcaNotificationDismissalModule.swift
  • mobile/modules/orca-notification-dismissal/ios/OrcaNotificationDismissalSubscriber.swift
  • mobile/modules/orca-notification-dismissal/ios/PushDismissalLedger.swift
  • mobile/modules/orca-notification-dismissal/package.json
  • mobile/modules/orca-notification-dismissal/tests/PushDismissalLedgerChecks.swift
  • mobile/package.json
  • mobile/patches/expo-notifications@55.0.27.patch
  • mobile/pnpm-workspace.yaml
  • mobile/src/home/use-mobile-home-host-connections.ts
  • mobile/src/notifications/NotificationDeliverySection.test.tsx
  • mobile/src/notifications/NotificationDeliverySection.tsx
  • mobile/src/notifications/desktop-notification-channel.test.ts
  • mobile/src/notifications/desktop-notification-channel.ts
  • mobile/src/notifications/desktop-notification-events.ts
  • mobile/src/notifications/expo-native-token-retry.test.ts
  • mobile/src/notifications/local-notification-scheduling.ts
  • mobile/src/notifications/mobile-notifications.test.ts
  • mobile/src/notifications/mobile-notifications.ts
  • mobile/src/notifications/mobile-push-lease-renewal.test.ts
  • mobile/src/notifications/mobile-push-lease-renewal.ts
  • mobile/src/notifications/native-notification-data.test.ts
  • mobile/src/notifications/native-notification-data.ts
  • mobile/src/notifications/native-push-dismissal.ios.ts
  • mobile/src/notifications/native-push-dismissal.test.ts
  • mobile/src/notifications/native-push-dismissal.ts
  • mobile/src/notifications/notification-catchup-failure-quarantine.test.ts
  • mobile/src/notifications/notification-consent-ownership.test.ts
  • mobile/src/notifications/notification-delivery-ordering.test.ts
  • mobile/src/notifications/notification-delivery-preferences.test.ts
  • mobile/src/notifications/notification-delivery-preferences.ts
  • mobile/src/notifications/notification-opt-in-gate.test.ts
  • mobile/src/notifications/notification-opt-in-gate.ts
  • mobile/src/notifications/notification-reconnect-catchup.ts
  • mobile/src/notifications/notification-reconnect-teardown.test.ts
  • mobile/src/notifications/notification-routing.test.ts
  • mobile/src/notifications/notification-routing.ts
  • mobile/src/notifications/notification-viewing-policy.ts
  • mobile/src/notifications/notification-watermark-seed-race.test.ts
  • mobile/src/notifications/push-background-dismissal.test.ts
  • mobile/src/notifications/push-background-dismissal.ts
  • mobile/src/notifications/push-dismissal-native-races.test.ts
  • mobile/src/notifications/push-dismissal-reconciliation.test.ts
  • mobile/src/notifications/push-dismissal-reconciliation.ts
  • mobile/src/notifications/push-dismissal-watermarks.test.ts
  • mobile/src/notifications/push-dismissal-watermarks.ts
  • mobile/src/notifications/push-host-fingerprint.test.ts
  • mobile/src/notifications/push-host-fingerprint.ts
  • mobile/src/notifications/push-notification-identity.test.ts
  • mobile/src/notifications/push-notification-identity.ts
  • mobile/src/notifications/push-payload.ts
  • mobile/src/notifications/push-preference-update.test.ts
  • mobile/src/notifications/push-receive.test.ts
  • mobile/src/notifications/push-receive.ts
  • mobile/src/notifications/push-registration-cancellation.test.ts
  • mobile/src/notifications/push-registration.test.ts
  • mobile/src/notifications/push-registration.ts
  • mobile/src/notifications/push-socket-dismissal.test.ts
  • mobile/src/notifications/push-socket-dismissal.ts
  • mobile/src/notifications/push-token.test.ts
  • mobile/src/notifications/push-token.ts
  • mobile/src/notifications/push-tray-dismissal.test.ts
  • mobile/src/notifications/push-tray-dismissal.ts
  • mobile/src/notifications/use-remote-push-capable-hosts.test.tsx
  • mobile/src/notifications/use-remote-push-capable-hosts.ts
  • mobile/src/onboarding/mobile-onboarding-screen.test.ts
  • mobile/src/settings/native-notification-delivery-settings.test.tsx
  • mobile/src/settings/native-notification-delivery-settings.tsx
  • mobile/src/settings/native-notification-settings-operations.ts
  • mobile/src/settings/notification-settings-screen.tsx
  • mobile/src/storage/preferences.test.ts
  • mobile/src/storage/preferences.ts
  • mobile/src/transport/host-removal-lifecycle.test.ts
  • mobile/src/transport/host-removal-lifecycle.ts
💤 Files with no reviewable changes (8)
  • mobile/src/notifications/notification-reconnect-catchup.ts
  • mobile/src/notifications/notification-watermark-seed-race.test.ts
  • mobile/src/notifications/local-notification-scheduling.ts
  • mobile/src/notifications/notification-delivery-ordering.test.ts
  • mobile/src/notifications/notification-reconnect-teardown.test.ts
  • mobile/src/notifications/notification-catchup-failure-quarantine.test.ts
  • mobile/src/notifications/notification-routing.ts
  • mobile/src/notifications/notification-routing.test.ts

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

Comment on lines +34 to +48
it('never presents an OS banner for socket alert or replay events', async () => {
const rpc = client()
subscribeToDesktopNotifications(rpc as never, 'host-1')
rpc.emit({ type: 'ready', subscriptionId: 'sub-1', epoch: 'epoch-1' })
rpc.emit({
type: 'notification',
notificationId: 'agent-1',
title: 'Needs input',
body: 'Reply',
source: 'agent-task-complete'
})
await Promise.resolve()
expect(requestNotificationCatchup).toHaveBeenCalledWith(rpc, 'host-1', expect.any(Function))
expect(dismissHostPushNotification).not.toHaveBeenCalled()
})

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

Assert scheduleNotificationAsync directly.

The socket path has no scheduling call, and its reachable notification APIs only inspect or dismiss presented notifications. Add the explicit mock and import so a future scheduling call can fail this test.

♻️ Proposed assertion on the notification API
 import { beforeEach, describe, expect, it, vi } from 'vitest'
+import * as Notifications from 'expo-notifications'
 import { subscribeToDesktopNotifications } from './mobile-notifications'
@@
+vi.mock('expo-notifications', () => ({
+  scheduleNotificationAsync: vi.fn(async () => 'scheduled-1')
+}))
 vi.mock('./push-socket-dismissal', () => ({
@@
     await Promise.resolve()
+    expect(Notifications.scheduleNotificationAsync).not.toHaveBeenCalled()
     expect(requestNotificationCatchup).toHaveBeenCalledWith(rpc, 'host-1', expect.any(Function))

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

Important

No new issues in this delta — the retry-on-failure capability probe is correct and well tested — but the iOS-only dismissal race flagged in the prior review is still open and untouched by this commit, so I'm not approving yet.

Reviewed changes

  • Retried push-capability probes — push-registration.ts now drives status.get through the shared startRuntimeCapabilityProbe (already used by use-remote-push-capable-hosts) instead of a one-shot read, retrying with backoff until a response lands and stopping the probe on re-attach, disconnect, and host removal.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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

Important

The three follow-up commits are correct and close the probe-lifecycle gaps cleanly, but approval is still held on the previously-flagged iOS dismissal race, which none of these commits touch.

Reviewed changes

  • Cancelled retired probes — attachPushRegistration, host removal, and the removal-restore path now stop and clear capabilityProbeStop; the detach callback also cancels a probe on the restored state object when the original client disconnects.
  • Ignored stale reconciliations — the probe start and its completion callback now both guard with isCurrent(), so a host removed or replaced mid-reconcile can no longer start a probe or set supported on a stale state.
  • Typed the probe at its boundary — startRuntimeCapabilityProbe now takes Pick<RpcClient, 'sendRequest'> instead of the full client.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@greptile-apps

greptile-apps Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Too many files changed for review (104 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

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

Important

No new issues in this delta — the pane-routing path is correct end to end — but the iOS-only dismissal race flagged in the prior review is still open and untouched by this commit, so I'm not approving yet.

Reviewed changes

  • Routed push taps to the originating pane — the originating paneKey now flows from the desktop dispatcher through the gateway's APNs/FCM payload to mobile, which parses it and selects the exact terminal/split pane instead of the first tab; closed or invalid panes fall back to workspace selection.

The matching logic is sound: the desktop builds paneKey as makePaneKey(parentTabId, leafId), so mobile's (parentTabId ?? id) === tabId && leafId === leafId comparison resolves the correct terminal tab, and the agent-session branch is a safe no-op fallback since agent notifications carry the parent terminal's pane key. The paneKey param is consumed unconditionally so a later tab snapshot can't steal selection, and the terminalsLoaded gate plus setParams({ paneKey: '' }) prevent a stale tab list from firing the switch early or twice.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@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 minor observation in the nitpicks below.

Reviewed changes

  • Required explicit push-service consent on upgrade — renamed the persisted consent key from orca:pushNotificationsEnabled to orca:pushServiceNotificationsEnabled, so every existing user (including those who had enabled the old socket notifications) is asked for fresh push-service consent instead of silently inheriting the prior choice; no production code reads the orphaned old key.
  • Simplified the opt-in gate — shouldPresentNotificationOptIn now reads only the persisted preference, dropping the OS-permission consultation and the auto-persist/auto-register side effects, leaving setRemotePushEnabled as the single registration path.
  • Added onboarding disclosure — the notifications step now states delivery is via Orca's push service and surfaces the default three-minute desktop-away policy.

ℹ️ Nitpicks

  • Dropping the gate's denied / !canAskAgain branch means an iOS user who permanently denied notification permission now sees the onboarding opt-in, and tapping "Enable" silently records false — ensureNotificationPermissions() returns false without prompting when canAskAgain is false, and chooseNotifications advances with no error or explanation. The removed branch previously skipped the opt-in for exactly this population (with a comment naming Settings as the recovery path); consider restoring that skip or surfacing a "could not enable" message in the onboarding error state.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

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

🧹 Nitpick comments (1)
mobile/src/notifications/mobile-notifications.test.ts (1)

33-57: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert that socket paths never schedule an OS notification. subscribeToDesktopNotifications ignores socket notification events, and catch-up only reconciles dismissals. These tests mock both helpers, so a future Notifications.scheduleNotificationAsync call can pass. Mock that API and assert it is not called for both the socket event and the ready/catch-up path. Add the same assertion to the catch-up tests while requestNotificationCatchup remains mocked here.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ba33ca25-226f-444c-9910-5e9fc8a3758c

📥 Commits

Reviewing files that changed from the base of the PR and between 0941e96 and 0790988.

📒 Files selected for processing (10)
  • mobile/src/notifications/notification-consent-ownership.test.ts
  • mobile/src/notifications/notification-opt-in-gate.test.ts
  • mobile/src/notifications/notification-opt-in-gate.ts
  • mobile/src/notifications/push-preference-update.test.ts
  • mobile/src/notifications/push-receive.test.ts
  • mobile/src/notifications/push-registration-cancellation.test.ts
  • mobile/src/onboarding/MobileOnboardingPage.tsx
  • mobile/src/onboarding/mobile-onboarding-styles.ts
  • mobile/src/storage/preferences.test.ts
  • mobile/src/storage/preferences.ts

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

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