You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS: crash (EXC_BREAKPOINT) with expo-updates 57 when launchAssetUrl() is read before AppController starts #507
@callstack/react-native-brownfield 6.0.0 (also on main at 5aa76a4)
expo-updates 57.0.26 (~57.0.26), Expo SDK 57
iOS, Expo runtime (ios/Expo)
What happens
A native iOS host crashes with EXC_BREAKPOINT when it creates its first React Native surface with ReactNativeBrownfield.shared.view(...) and the app has Updates enabled (updates.enabled: true, checkAutomatically: ON_LOAD).
Reproduction
Expo SDK 57 app packaged with brownfield package:ios, with expo-updates enabled.
In the native host, create a surface with ReactNativeBrownfield.shared.view(...).
The app crashes before the surface loads.
Cause
Brownfield calls AppController.sharedInstance.launchAssetUrl() before the controller is started:
ExpoUpdatesStartup.prepareReactNative checks controller.launchAssetUrl() != nil before it calls controller.start().
ExpoHostRuntimeDelegate.bundleURL() and isBundleURLStable call it too, which can also happen before start().
In expo-updates 57, EnabledAppController.launchAssetUrl() reads startupProcedure, an implicitly unwrapped optional that only start() sets:
So the call traps. expo-updates 58 made startupProcedure optional (startupProcedure?.launchAssetUrl()), which is why Expo 58 doesn't crash.
Proposed fix
Check AppController.sharedInstance.isStarted before calling launchAssetUrl() in those three places. Before start() there is no launch asset anyway, so the behavior on Expo 58 doesn't change. We have run this as a local patch on an Expo 57 brownfield host, and OTA updates and rollback work with it. I'll open a PR.
Activity