Skip to content

fix(mobile): defer async initial link updates until mount - #5613

Merged
iscekic merged 2 commits into
mainfrom
fix/mobile-android-cold-start
Aug 27, 2026
Merged

fix(mobile): defer async initial link updates until mount#5613
iscekic merged 2 commits into
mainfrom
fix/mobile-android-cold-start

Conversation

@iscekic

@iscekic iscekic commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Patch Expo Router 57.0.10 to report asynchronous initial links from an effect, not a render-started callback.
  • Cancel the report on unmount and consume it once, preserving synchronous startup and warm links.
  • Add seven mounted regression tests against the installed router under Strict Mode.

Verification

  • Built and installed the Android development app on kilo_pixel9_api35, emulator-5554.
  • Confirmed this worktree's Metro provenance and signed in with the dedicated test account.
  • Terminated and relaunched the app three times. Each run reached Home with the tab bar visible.
  • Rebooted Android, verified an increased boot count and completed boot, then relaunched the app and reached Home.
  • Checked runtime logs for the reported React state-update warning and useLinking.native. No matches appeared.

An earlier repeat stopped at the development-client chooser after the host network changed. After regenerating endpoints, all four checks passed.

Local screenshots and logs: /var/folders/pz/_kmbp8vs2755j415slh2hz100000gn/T/kilo/pr-5613-android/stable-network/.

Visual Changes

N/A

Reviewer Notes

  • The original router failed both lifecycle assertions: before mount and after unmount.
  • Targeted startup checks passed: 113 pure tests and 11 mounted tests.
  • Mobile typecheck, lint, unused-code checks, repository format check, and git diff --check passed.
  • The frozen offline install passed with the patch.
  • Expo Doctor passed 20 of 21 checks. It reported existing patch-version mismatches across 21 packages; this PR changes no package versions.
  • The branch starts at e186f2d, the latest origin/main when work began.

CI scoping follow-up

  • Compare resolved dependency graphs, package metadata, and dependency patches instead of selecting every workspace for shared pnpm edits.
  • Keep resolved optional peers in coverage. Ignore native-only React Native patches for non-native consumers.
  • Gate extension verification and browser tests on extension source, shared dependencies, workflow, and tooling changes.
  • Run all packages when global configuration changes or dependency detection fails.
  • Verified the original mobile-only range with node scripts/changed-dependencies.mjs e186f2d0d 71698a97c; it selects only apps/mobile.
  • All 18 selector tests, repository lint, typecheck, format checks, and 78 mobile link checks passed.

This PR still exercises extension CI because it changes the extension workflow and root tooling. Repository-wide checks and the web CI gate remain broader. Device verification results are below.

iOS and link verification

  • Built and installed the iOS development app on an iPhone 17 Pro simulator.
  • iOS cold startup passed both signed in and signed out.
  • iOS warm profile and preferences links reached the requested destinations.
  • iOS cold profile and preferences links reached the requested destinations.
  • A signed-out iOS cold preferences link showed login, then resumed Preferences after email-code verification. No second link was sent.
  • Android warm profile and preferences links reached the requested destinations.
  • Runtime log checks showed no matching React mount warnings.
  • All 71 pure link checks and seven mounted router checks passed. These include universal-link mapping.

Remaining device coverage: Android cold custom-scheme navigation stopped in Expo DevLauncherActivity before the app loaded. One documented recovery failed. Cold profile navigation remains unverified; cold preferences navigation did not run. Native OS delivery of universal links was not tested.

Local evidence:

  • /var/folders/pz/_kmbp8vs2755j415slh2hz100000gn/T/kilo/pr-5613-links-ios/
  • /var/folders/pz/_kmbp8vs2755j415slh2hz100000gn/T/kilo/pr-5613-links-android/

All current PR checks passed after the CI-scoping commit, including Chrome extension tests.

@iscekic iscekic self-assigned this Aug 27, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the CI scoping follow-up that detects affected workspaces from lockfile and patch graphs; no correctness or fail-open gating issues found.

Files Reviewed (7 files)
  • .github/workflows/ci.yml
  • .github/workflows/extension-ci.yml
  • package.json
  • pnpm-lock.yaml
  • scripts/changed-dependencies.mjs
  • scripts/changed-dependencies.test.mjs
  • scripts/changed-workspaces.sh
Previous Review Summary (commit 71698a9)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 71698a9)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the expo-router 57.0.10 patch that defers async initial-link reporting to a cancellable mount effect, plus its mounted regression tests; no correctness, lifecycle, or leak issues found.

Files Reviewed (5 files)
  • apps/mobile/.oxlintrc.json
  • apps/mobile/src/lib/expo-router-linking.mounted.test.tsx
  • patches/expo-router@57.0.10.patch
  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Reviewed by grok-4.6 · Input: 119.4K · Output: 21.4K · Cached: 385.4K

Review guidance: REVIEW.md from base branch main

@iscekic

iscekic commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Android verification passed: three cold process launches and one full emulator reboot. Each case reached Home, and runtime logs contained no matching React mount warning.

The emulator, Appium server, local stack, and E2E slot are released. The worktree is clean.

Mobile CI, repository lint, typecheck, tests, and build passed. The remaining failure is the Chrome extension scroll assertion at apps/extension/tests/e2e/agents-mode.test.ts:793: atBottom is false. No extension files changed in this PR.

Chrome job

@iscekic
iscekic merged commit f603423 into main Aug 27, 2026
72 checks passed
@iscekic
iscekic deleted the fix/mobile-android-cold-start branch August 27, 2026 19:27
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.

2 participants