Skip to content

[menu-bar] Fix crash when opening app via deep link from cold start#320

Merged
gabrieldonadel merged 2 commits intomainfrom
@gabrieldonadel/fix-deep-link
Mar 18, 2026
Merged

[menu-bar] Fix crash when opening app via deep link from cold start#320
gabrieldonadel merged 2 commits intomainfrom
@gabrieldonadel/fix-deep-link

Conversation

@gabrieldonadel
Copy link
Copy Markdown
Member

@gabrieldonadel gabrieldonadel commented Mar 18, 2026

Why

Expo Orbit crashes when opened via deep link (open "expo-orbit:///download/?url=...") if the app is not already running.

Closes #311

How

The crash was caused by a race condition during app startup. The applicationWillFinishLaunching registers the Apple Event handler for URL schemes, but popoverManager is only initialized later in loadReactNativeWindow (called after super.applicationDidFinishLaunching). When macOS launches the app in response to a deep link, the URL Apple Event can be dispatched during super.applicationDidFinishLaunching (before popoverManager is set). Since popoverManager is declared as an implicitly unwrapped optional (PopoverManager!), accessing it while nil causes a SIGTRAP crash.

By using optional chaining on popoverManager, the function call is safely skipped if the manager isn't initialized yet. RCTLinkingManager will still receive the URL event, and the deep link gets processed once React Native finishes loading.

Test Plan

  1. Quit Expo Orbit completely
  2. Run open "expo-orbit:///download/?url=https%3A%2F%2Fexpo.dev%2Fartifacts%2Feas%2Ff33ukJUZmMKb88egay8Tra.tar.gz"
  3. Verify the app launches without crashing and processes the deep link
  4. With the app already running, run the same command and verify it still works
Screen.Recording.2026-03-17.at.23.50.16.mov

@gabrieldonadel gabrieldonadel requested a review from tchayen March 18, 2026 12:53
@gabrieldonadel gabrieldonadel merged commit c3ba030 into main Mar 18, 2026
1 check passed
@gabrieldonadel gabrieldonadel deleted the @gabrieldonadel/fix-deep-link branch March 18, 2026 16:03
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.

EAS website "Open with Orbit" link doesn't work

2 participants