Instrument iOS cold-start phases - #2293
Conversation
Instrument native OTA, JavaScript, auth, splash, and deferred service startup before changing launch policy. Refs #2193
Keep phase durations visible in local Release console output while retaining structured telemetry attributes. Refs #2193
Document the controlled signed Release timings, unchanged launch policy, and unresolved production observability gap. Refs #2193
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
Warning Review limit reached
Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
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. Comment |
Reviewer's GuideThis PR introduces a coordinated iOS mobile startup telemetry pipeline that samples a single Sequence diagram for coordinated iOS Mobile Startup telemetry phasessequenceDiagram
actor User
participant AppProcess
participant StartupTelemetry
participant AuthProvider
participant RootLayout
participant BackgroundServices
participant ExpoUpdates
participant Sentry
participant Logger
AppProcess->>StartupTelemetry: startStartupTelemetry()
StartupTelemetry->>ExpoUpdates: read launchDuration
StartupTelemetry-->>StartupTelemetry: create Mobile Startup span
StartupTelemetry-->>StartupTelemetry: create OTA launch span
StartupTelemetry-->>Logger: info app-startup phase=ota
StartupTelemetry-->>StartupTelemetry: startPhaseAt javascript
RootLayout-->>StartupTelemetry: finishStartupPhase(javascript, ready)
AuthProvider->>StartupTelemetry: startStartupPhase(authentication)
AuthProvider-->>AuthProvider: retryBootstrap()
AuthProvider-->>StartupTelemetry: finishStartupPhase(authentication, authenticated | unauthenticated | deferred | error)
RootLayout->>StartupTelemetry: startStartupPhase(splash-hide)
RootLayout->>RootLayout: SplashScreen.hideAsync()
RootLayout->>StartupTelemetry: markAppInteractive(serviceBootstrapExpected)
StartupTelemetry-->>Sentry: appLoaded()
alt serviceBootstrapExpected
RootLayout->>StartupTelemetry: startStartupPhase(service-bootstrap)
BackgroundServices-->>BackgroundServices: initBackgroundHealthKitSync()
BackgroundServices-->>BackgroundServices: initBackgroundAccelerometerSync()
BackgroundServices-->>BackgroundServices: initBackgroundWatchInertialMeasurementUnitSync()
BackgroundServices-->>StartupTelemetry: finishStartupPhase(service-bootstrap, ready | error)
else unauthenticated path
StartupTelemetry-->>StartupTelemetry: startStartupPhase(service-bootstrap)
StartupTelemetry-->>StartupTelemetry: finishStartupPhase(service-bootstrap, skipped)
end
StartupTelemetry-->>Logger: info app-startup phase completions
StartupTelemetry-->>Sentry: end Mobile Startup span
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Mobile PreviewScan to open on device:
To test on device:
|
PR Summary by QodoInstrument iOS cold-start phases with Sentry telemetry
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
|
Storybook previews for This comment updates automatically on each PR push. |
Code Review by Qodo
Context used✅ Compliance rules (platform):
171 rules✅ Skills:
fix-provider, write-tests, cloudflare 1.
|
Start a fresh authentication child span when a locked-device restore defers and later retries in the foreground. Also remove agent-only plan text and place the Expo citation beside its claim. Refs #2193
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
Summary
Evidence
The signed ad-hoc Release bundle passed strict code-signature verification and rendered the login screen without a fatal runtime error. Three force-stop launches reached interactive in 712.7 ms, 968.0 ms, and 659.6 ms; a clean reinstall took 863.8 ms. OTA was 631.6–942.0 ms and all measured JS/auth/splash phases were at most 11 ms. No evidence supports changing
fallbackToCacheTimeout.Production classification remains blocked by expired Axiom connector access and the absence of historical Sentry startup spans; the issue and incident baseline record this gap.
Validation
pnpm exec vitest run --project mobile packages/mobile/lib/telemetry.test.ts packages/mobile/app/_layout.cleanup.test.tsx packages/mobile/lib/auth-context.test.ts packages/mobile/lib/startup-telemetry.test.ts(37 passed)scripts/compose-env.test.tsDocker CLI child hung during teardown under shared Docker contentionFixes #2193
Summary by Sourcery
Instrument iOS mobile cold-start with correlated Sentry startup spans and logs across OTA, JavaScript, authentication, splash dismissal, and deferred service bootstrap, and document the measurements and incident outcome.
New Features:
Enhancements:
Documentation:
Tests:
Summary by cubic
Instrumented iOS cold start to attribute time across OTA, JavaScript, authentication, splash dismissal, and deferred service bootstrap, and to mark the app interactive at splash hide; no launch policy change was needed. Fixes #2193.
packages/mobile/lib/startup-telemetry.tsto start a "Mobile Startup" transaction via@sentry/react-nativewith child spans for each phase.expo-updatesmetadata (includingUpdates.launchDuration) and creates an "OTA launch" span that ends at JavaScript start.AuthProviderand_layout.tsxto start/finish phase spans, callSentry.appLoaded()after splash, record outcomes (ready/authenticated/unauthenticated/deferred/error), start a new auth span after a deferred restore, and measure deferred service bootstrap.app-startuplogs mirroring phase durations for Release audits and OTLP correlation.tracesSamplerinlib/telemetry.ts.startup-telemetry.test.ts) and updated docs (README.md, incident baseline); keptfallbackToCacheTimeoutunchanged.Written for commit 7059157. Summary will update on new commits.