Skip to content

[iOS] Promise hangs when calling MobileCore.initialize again #518

@robrechtme

Description

@robrechtme

Prerequisites

  • This is not a Security Disclosure, otherwise please follow the guidelines in Security Policy.
  • I have searched in this repository's issues to see if it has already been reported.
  • I have updated to the latest released version of the SDK and the issue still persists.

Bug summary

The MobileCore.initialize promise never gets resolved when called a second time.

await MobileCore.initialize(initOptions); // resolves
console.log('resolved');
await MobileCore.initialize(initOptions); // hangs
console.log('code never reaches here');

This is in theory not an issue, since you should only call this once, but it breaks hot reload during development. For instance, if your code depends on the promise resolving to hide the splash screen, but the promise never resolves when hot reloading the app, the splash screen never gets hidden. Only a cold boot fixes the issue.

await MobileCore.initialize(initOptions); // stuck here when hot reloading
await SplashScreen.hideAsync();

Environment

System:
  OS: macOS 15.6
  CPU: (12) arm64 Apple M3 Pro
  Memory: 474.25 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.17.0
Managers:
  CocoaPods:
    version: 1.16.2
SDKs:
  iOS SDK:
    Platforms:
      - iOS 18.5
IDEs:
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
npmPackages:
  @adobe/react-native-aepassurance: 7.0.0
  @adobe/react-native-aepcore: 7.0.0
  @adobe/react-native-aepedge: 7.0.0
  @adobe/react-native-aepedgebridge: 7.0.1
  @adobe/react-native-aepedgeconsent: 7.0.0
  @adobe/react-native-aepedgeidentity: 7.0.0
  @adobe/react-native-aepuserprofile: 7.0.0
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

No response

Current behavior

No response

Expected behavior

No response

Anything else?

No response

Metadata

Metadata

Labels

bugSomething isn't workingtriage-requiredTriage required on a new issue logged for this project. Used by issue templates

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions