Skip to content

Restore mobile push and fix cold-start dismissals - #20068

Merged
Jinwoo-H merged 12 commits into
mainfrom
fix/mobile-push-recovery
Sep 12, 2026
Merged

Jinwoo-H merged 12 commits into
mainfrom
fix/mobile-push-recovery

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 45 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3358 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2102 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1256
Prod 67 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3381 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2202 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1179

Restores mobile push for delivery validation after the rollout revert. Android cold background launches now register the dismissal task before the router starts, so dismissals can run without mounting a screen.

Depends on #20066, which prevents Google from collapsing distinct pending alerts. This PR remains unmerged while recovery is tested.

Validation: full mobile suite (4,426 passed, 3 skipped), typecheck, and a standalone Android emulator build. With a controlled Google connection, six offline alerts all appeared; a cold-start dismissal removed only its target; tapping an alert opened Terminal 2 in its workspace. The separate network connection failure is not fixed by these changes.

Production gateway verification after deployment of #20066: confirmed app process absent, queued six alerts offline, received all six after Google's automatic fallback to port 443 (~73 seconds), then dismissed only alert 1 while 2–6 remained. No network workaround used. Temporary registration removed. Mobile CI verify passed.

@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

iOS release builds will still get an aps-environment: development entitlement: app.config.js derives the mode from ORCA_IOS_APS_ENVIRONMENT, but nothing in the repo sets it. See the inline comment.

Reviewed changes

  • Push delivery becomes gateway-only. local-notification-scheduling.ts and the watermark/seq/epoch catch-up machinery in notification-reconnect-catchup.ts are deleted; the socket stream now carries only dismiss events plus the ready frame that triggers reconciliation.
  • Per-host push registration. push-registration.ts registers a device token per authenticated, push-capable host, persists a registered/pending-unregister outbox, renews a lease while foregrounded, and re-registers on token roll.
  • Cold-start dismissal. mobile/index.js becomes the entry point and imports the background dismissal task; _layout.tsx registers the task, the orca-desktop channel, and token sync at module load so a cold-start dismissal needs no mounted screen.
  • Native iOS dismissal ledger. A local Expo module (orca-notification-dismissal) keeps sequence-fenced dismissals in UserDefaults, mirrored by JS watermarks on Android/web.
  • Host fingerprinting. The gateway names a host by base64url(sha256(publicKey))[:16], mapped back to the paired hostId through the host catalog.
  • Consent/registration preference split. orca:pushNotificationsEnabled is renamed to orca:pushServiceNotificationsEnabled; legacy consent is intentionally ignored and re-prompted.

ℹ️ Firebase API key committed in google-services.json

mobile/google-services.json commits a Firebase api_key and an OAuth client_id. That is standard for Firebase client config, but an unrestricted key is usable outside the app. Before this ships, restrict AIzaSyBmT_w0OUQSiVfxblx-F0qlRvGkBBkTNQU in Google Cloud Console to the Android package (com.stably.orca.mobile + SHA-1) and to the APIs the gateway uses. No code change required, but worth confirming the key isn't unrestricted.

ℹ️ iOS native module and APNs path are not covered by the stated validation

The PR validation lists a full mobile unit suite, typecheck, and a standalone Android emulator build. The new iOS native module (mobile/modules/orca-notification-dismissal) and the app.config.js entitlements path (which is currently broken — see inline) have no iOS build/pod-install coverage. A one-off expo prebuild --platform ios + pod-install + archive before merge would catch both the missing env var and any autolinking gap in requireNativeModule('OrcaNotificationDismissal'), which throws at startup if the module is not linked.

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

Comment thread mobile/app.config.js Resolved
@greptile-apps

greptile-apps Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

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

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

@Jinwoo-H
Jinwoo-H force-pushed the fix/mobile-push-recovery branch from 75433fb to 98df0e2 Compare September 11, 2026 21:01

@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

The prior blocking finding — iOS release builds getting a sandbox aps-environment entitlement — is fixed, and the new test-push diagnostic is correctly plumbed end to end.

  • Fixed the iOS release entitlement gap. mobile-ios-release.yml now sets ORCA_IOS_APS_ENVIRONMENT: production in the Expo prebuild step, and app.config.js derives both the expo-notifications plugin mode and ios.entitlements['aps-environment'] from that same env var, so the entitlement and the reported token environment agree by construction.
  • Added an authenticated mobile test-push endpoint. notifications.testPush is a no-arg, mobile-only RPC that forwards the caller's pairedDeviceId to DesktopPushService.test(), which sends a single terminal-bell alert to only that registration and awaits gateway acceptance, mapping failure reasons through MobilePushTestResult.
  • Added the mobile test-push UI. notification-display-test.tsx renders a "Send test notification" button inside the notifications settings screen with descriptive failure messages, plus a "Push Notifications" troubleshooting section.

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

@Jinwoo-H
Jinwoo-H changed the base branch from fix/android-push-offline-delivery to main September 11, 2026 21:02

@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

  • Mocked the new push-test transport in the consent-ownership test. notification-consent-ownership.test.ts now stubs use-all-host-clients and host-store (loadHostCatalog), the two ../transport imports that NotificationDisplayTest pulls into the notifications route. This keeps the consent test hermetic without touching production behavior.

Pullfrog  | 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 new issues found.

Reviewed changes

  • Fixed a vacuous slept-workspace remount assertion. The rebase onto main (which landed #20075's structured remountTerminalTabForRecovery result) left slept-workspace-remount-wake.spec.ts comparing the always-truthy result object to true. The test now reads .remounted, so the "did not find the slept tab" oracle actually fails when the remount declines.

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

@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

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: 70e9545d-249d-4eb0-92c1-920532c395cb

📥 Commits

Reviewing files that changed from the base of the PR and between 5773b03 and 8fe17a3.

📒 Files selected for processing (1)
  • src/main/runtime/structured-session-worktree-teardown.test.ts

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


📝 Walkthrough

Walkthrough

The mobile app now supports production-configured push delivery, native dismissal persistence, foreground and background push handling, host-scoped registration, delivery preferences, dismissal reconciliation, notification routing, and notification troubleshooting. The runtime adds a mobile push test RPC that sends test notifications to registered devices. Related onboarding, settings, storage, native module, and test coverage changes are included.

Priority: ⬆️ High

Merge Risk: 🔵 Low · up to 8fe17

The push changes are otherwise ready, but one notification display test may assert before its asynchronous operation finishes and miss failures.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main behavior changes and validation results, but it omits most required template sections, including ELI5, What Changed, Why, Visual Proof or an explicit N/A, Testing che… Complete the required template sections. Add an ELI5 summary, detailed What Changed and Why sections, the issue link in the required format, Visual Proof or an explicit N/A with a reason, Testing details and checklist status, Review, Agent …
Docstring Coverage ⚠️ Warning Docstring coverage is 9.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 81 functions across 61 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 summarizes the main changes: restoring mobile push and fixing cold-start dismissals.
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 explains the main behavior changes and validation results, but it omits most required template sections, including ELI5, What Changed, Why, Visual Proof or an explicit N/A, Testing checkboxes, Review, Notes, and Checklist. It also lists a dependency instead of clearly identifying the issue this PR fixes.

Resolution

Complete the required template sections. Add an ELI5 summary, detailed What Changed and Why sections, the issue link in the required format, Visual Proof or an explicit N/A with a reason, Testing details and checklist status, Review, Agent skill boundary, Notes, and the remaining Checklist items.

✨ 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: 5


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: fe0b2f8b-0f0e-4735-af0b-8064697f8e5b

📥 Commits

Reviewing files that changed from the base of the PR and between 7294915 and d837b3e.

⛔ Files ignored due to path filters (3)
  • mobile/assets/notification-icon.png is excluded by !**/*.png
  • mobile/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/shared/rpc-contract/rpc-params-catalog.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (102)
  • .github/workflows/mobile-ios-release.yml
  • 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/index.js
  • 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/diagnostics/troubleshoot-common-issues.tsx
  • 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/MobileOnboardingPage.tsx
  • mobile/src/onboarding/mobile-onboarding-screen.test.ts
  • mobile/src/onboarding/mobile-onboarding-styles.ts
  • mobile/src/session/mobile-session-route-parity.test.ts
  • mobile/src/session/mobile-session-route.ts
  • mobile/src/session/use-mobile-session-controller.ts
  • mobile/src/session/use-notification-pane-navigation.test.tsx
  • mobile/src/session/use-notification-pane-navigation.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-display-test.tsx
  • 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
  • mobile/src/transport/runtime-capability-probe.ts
  • src/main/runtime/push/desktop-push-service.test.ts
  • src/main/runtime/push/desktop-push-service.ts
  • src/main/runtime/push/push-registration-rpc.test.ts
  • src/main/runtime/rpc/methods/notifications.ts
  • src/main/runtime/runtime-mobile-notification-controller.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-mobile-method-allowlist.ts
  • src/main/runtime/runtime-service-command-surface.ts
  • src/shared/mobile-push-contract.ts
  • tests/e2e/slept-workspace-remount-wake.spec.ts
💤 Files with no reviewable changes (6)
  • mobile/src/notifications/notification-watermark-seed-race.test.ts
  • mobile/src/notifications/notification-catchup-failure-quarantine.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-reconnect-catchup.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this 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.

✅ No new issues found.

Reviewed changes

This run reviewed commit 7dcb481 ("Fix mobile notification review findings"), which resolves the five findings from the previous (coderabbit) review and adds regression coverage for each. No new issues were found.

  • Restricted ID-only tray dismissals to unversioned entries. push-tray-dismissal.ts now treats an absent or incomplete dismissal fence as "only unversioned alerts", so a legacy/ID-only dismissal can no longer clear a newer versioned alert with the same host and ID. A complete fence still bounds the match by epoch and seq <= fence.seq.
  • Cleared stale capability answers on reconnect. use-remote-push-capable-hosts.ts drops a host's cached supported answer when a replacement probe starts, so a reconnected client re-resolves instead of latching the old client's verdict; a plain disconnect still retains its earlier answer.
  • Serialized delivery-settings refresh against saves. native-notification-delivery-settings.tsx adds a refreshRevision/saveInProgress guard so a pre-save refresh that resolves later cannot overwrite a completed save.
  • Tried the push test across connected desktops. notification-display-test.tsx now iterates connected clients, retrying on definitive non-delivery responses (forbidden, method_not_found, not_registered) and failing fast on transport errors or rate_limited.
  • Strengthened regression assertions. Added tests cover the multi-desktop retry, the reconnect re-probe, the stale-refresh race, the incomplete fence, and the onboarding retry persistence call.

Pullfrog  | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 94cb3461-6258-4f13-8ea1-f396e83ece9e

📥 Commits

Reviewing files that changed from the base of the PR and between d837b3e and 7dcb481.

📒 Files selected for processing (11)
  • mobile/src/notifications/push-background-dismissal.test.ts
  • mobile/src/notifications/push-socket-dismissal.test.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/notification-display-test.test.tsx
  • mobile/src/settings/notification-display-test.tsx
🚧 Files skipped from review as they are similar to previous changes (9)
  • mobile/src/notifications/push-background-dismissal.test.ts
  • mobile/src/notifications/push-tray-dismissal.test.ts
  • mobile/src/onboarding/mobile-onboarding-screen.test.ts
  • mobile/src/notifications/push-socket-dismissal.test.ts
  • mobile/src/settings/native-notification-delivery-settings.test.tsx
  • mobile/src/notifications/use-remote-push-capable-hosts.test.tsx
  • mobile/src/notifications/push-tray-dismissal.ts
  • mobile/src/settings/native-notification-delivery-settings.tsx
  • mobile/src/notifications/use-remote-push-capable-hosts.ts

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

await act(async () => {
renderer = create(createElement(NotificationDisplayTest, { onTroubleshoot: vi.fn() }))
})
await act(async () => renderer.root.findAllByType('Pressable')[0].props.onPress())

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

Return the run() promise from the Pressable handler.

The handler returns undefined, so the async act callback can finish before sendRequest and the final state updates complete.

Proposed fix
-        onPress={() => void run()}
+        onPress={() => run()}

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
mobile/app.config.js (1)

1-32: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Set ORCA_IOS_APS_ENVIRONMENT=production in every production Fastlane lane before build_app. The GitHub workflow sets it during expo prebuild, but the exported release and build_and_upload lanes do not. A direct lane invocation can therefore build a workspace with the default aps-environment: development. Release builds report apnsEnvironment: production, so the gateway sends the token to api.push.apple.com; APNs can reject the sandbox token and production pushes will not be delivered.

mobile/src/notifications/push-background-dismissal.ts (1)

1-140: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Register orca-push-dismissal from the early entrypoint. Expo requires notification tasks to be defined and registered in an early module. mobile/index.js imports the task definition before expo-router/entry, but registration currently runs only from _layout.tsx, which headless launches do not mount. A headless dismissal can therefore arrive before registerTaskAsync runs, so the callback is not invoked and the presented notification remains visible. Move the registration call beside defineTask in push-background-dismissal.ts.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 987ebd97-9910-446c-ba8f-733b9775efba

📥 Commits

Reviewing files that changed from the base of the PR and between 0dfd3e3 and 5773b03.

⛔ Files ignored due to path filters (1)
  • mobile/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • mobile/package.json
  • mobile/patches/expo-notifications@55.0.27.patch

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this 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.

✅ No new issues found.

Reviewed changes

This run reviewed commit 5773b03 ("present visible Android data pushes in foreground"), the only commit since the prior pullfrog review. It aligns Android foreground push presentation with expo's own native background visibility policy, and verifies cleanly against the expo-notifications SDK 55 source.

  • Routed visible Android data pushes through the JS foreground handler. The expo-notifications@55.0.27 patch now only early-returns data-only FCM messages whose title and text are both empty, so a message carrying display text reaches SingleNotificationHandlerTask and the JS setNotificationHandler can present it. The predicate is identical to expo's own shouldPresent() check, and ExpoHandlingDelegate only invokes onNotificationReceived while the app is foregrounded (background goes through the native present path), so this is foreground-only and cannot duplicate or drop background tray notifications.
  • Forced the patched Kotlin to compile. mobile/package.json opts expo-notifications out of Expo's prebuilt Android modules via expo.autolinking.android.buildFromSource; without it the patched .kt would be ignored in favor of the prebuilt AAR. The pnpm lock patch hash was bumped to match.

No inline comments. Prior pullfrog threads remain resolved.

Pullfrog  | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (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 new issues found.

Reviewed changes

This run reviewed commit 8fe17a3 ("test: use deterministic clock for teardown deadline"), the only commit since the prior pullfrog review. Test-only and unrelated to mobile push.

  • Made the teardown deadline test deterministic. structured-session-worktree-teardown.test.ts now drives killAllProcessesForWorktree under vi.useFakeTimers() with advanceTimersByTimeAsync, replacing the real setTimeout(25) wait, so the 5ms budget expiry and the post-release close-ordering assertion no longer hinge on wall-clock timing. The assertions are unchanged, and the suite passes (30/30 locally).

Pullfrog  | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (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 new issues found.

Reviewed changes

This run reviewed commit 8f4a811 ("fix(mobile): present foreground pushes through Expo public APIs"), the only commit since the prior pullfrog review. It replaces the native expo-notifications patch with a JS listener and reverts the Android buildFromSource override.

  • Replaced the native Kotlin patch with Expo public APIs. mobile/src/notifications/android-foreground-push.ts subscribes to addNotificationReceivedListener; for Android data-only push triggers (remoteMessage.notification === null) carrying a recognized Orca payload with visible text, it re-schedules the alert via scheduleNotificationAsync, preserving the original identifier, content, and channelId target.
  • Reverted the Android build-from-source override. The NotificationsHandler.kt hunk is removed from mobile/patches/expo-notifications@55.0.27.patch (leaving only the token-retry fix) and the expo.autolinking.android.buildFromSource block is dropped from mobile/package.json; the lockfile patch hash is bumped to match.
  • Wired the listener into the app root. _layout.tsx starts it in a mount effect, mirroring the adjacent token-sync subscription.

Verified against the expo-notifications sdk-55 source: ExpoHandlingDelegate.handleNotification notifies every registered listener in the foreground, so a data-only push still reaches NotificationsEmitter even though NotificationsHandler early-returns for data-only content. Re-scheduling with a null/ChannelAware trigger routes back through NotificationsHandler, so the local notification still flows through foregroundNotificationBehavior (consent / host / viewing / dismissal suppression) and is presented exactly once — no double banner and no regression to the dispatch path.

Pullfrog  | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (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 new issues found.

Reviewed changes

This run reviewed commit de91281 ("fix(mobile): check push eligibility before foreground scheduling"), the only commit since the prior pullfrog review.

  • Split the one-shot duplicate claim from eligibility. shouldSuppressForegroundPush no longer consumes claimForegroundPush; foregroundNotificationBehavior now composes ineligible || (payload !== null && !claimForegroundPush(payload)), preserving the prior "claim only when eligible" short-circuit (the claim stays unconsumed when any consent/host/viewing/dismissal check suppresses).
  • Added a non-consuming preflight. canPresentForegroundPush(payload) exposes the eligibility check without claiming, and android-foreground-push.ts awaits it before scheduleNotificationAsync, so a dismissed, unpaired, viewing-suppressed, or consent-off data push is never re-scheduled. This is load-bearing because when native presentation bypasses the JS handler, the preflight is the only eligibility guard — the claim never runs.
  • Preflight failures fail closed. A rejected eligibility read is caught by the existing present().catch (warn, no schedule), and foregroundNotificationBehavior retains its .catch(() => payload !== null) closure for recognized pushes.
  • Added regression coverage. Tests assert the preflight does not consume the final claim, a dismissal observed after the preflight suppresses scheduling, and a rejected eligibility read logs and schedules nothing.

Verified the mobile suite for the touched/related files (android-foreground-push, push-receive, push-dismissal-native-races): 26 tests pass.

Pullfrog  | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (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 new issues found.

Reviewed changes

This run reviewed commit c7b0e0b ("fix(mobile): register push from shared host connection lifecycle"), the only commit since the prior pullfrog review. It moves gateway push registration out of the home screen hook and into the shared host-entry lifecycle, so a paired host registers whenever its client is opened instead of only when the home screen mounts.

  • Moved attachPushRegistration into the shared opener. host-entry-opener.ts now attaches once on connected (??=), detaches on any non-connected transition and on unsubState; use-mobile-home-host-connections.ts drops its duplicate copy, so registration tracks the client's auth state rather than the home screen's mount.
  • Added lifecycle regression coverage. Two client-context.test.ts tests assert attach-on-connect (including an already-authenticated host), no double-attach on a repeated connected, detach on disconnect, re-attach on reconnect, and detach on unmount/explicit disconnect.
  • Stubbed the new transport-layer import in existing tests. host-open-recovery.test.tsx and settings-host-client-lifecycle.test.ts mock ../notifications/push-registration, keeping those transport tests off the expo-notifications module path now reachable from client-context. Production attachPushRegistration is idempotent per client and no-ops on non-push-capable hosts, so the widened call site does not double-register.

Pullfrog  | View workflow run | Using openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 341b13c into main Sep 12, 2026
35 checks passed
Fartown pushed a commit to Fartown/orca that referenced this pull request Sep 13, 2026
Each of the four conflict resolutions checked directly rather than by assertion:
the app config evaluated under all four env combinations, every script named in
`lint` resolved and diffed against upstream's, and both statements in the hook
server proved covered by deleting each and watching a gate go red. The e2e spec
parses and keeps both sides' changes.

The delivery's move to typed RPC operations re-verified end to end on a Xiaomi 15
against a real Orca host: 1506/1506 bytes identical to the shared kernel, zero
engine errors, zero dropped stream events. The seven outcome mappings stay
covered because the unit tests fake at the transport port, so runRpcOperation's
decode and acceptance policy execute for real.

One problem only a device could show: upstream stablyai#20068 adds the expo-task-manager
native module, so the pre-merge dev client white-screened on `Cannot find native
module 'ExpoTaskManager'`. Rebuilt and reinstalled; recorded that a native
dependency change now requires rebuilding the client before any device run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ddyy32VYir3LAeFDHv71UT
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