Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-2853

RN event loop stuck when using realm with an expo development build

      How frequently does the bug occur?

      Always

      Description

      I use an expo development build with realm "@realm/react": "0.6.2", and "realm": "12.6.2"
      along with RN version: "react-native": "0.72.7"
      When ever I tried to load the JS bundle via expo development client, the bundle is stuck at "Downloading 100%".

      On diving deeper, the following code in ReactRealm.mm seems to be stuck in a infinite loop causing JS event loop/thread to block indefinitely:

                while (s_currentJSThread && !s_currentJSThread.finished) {
                  [NSThread sleepForTimeInterval:0.1];
                }
      

      Is there a known workaround or fix for this issue?

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Always

      Reproduction Steps

      1. Create an expo app repo with developmentClient: true for expo development build.
      2. Add realm with following versions: "@realm/react": "0.6.2", and "realm": "12.6.2"
        along with RN version: "react-native": "0.72.7"
      3. Try to load a JS bundle via development client.
      4. Bundle is stuck at "Downloading 100%"

      Version

      0.6.2

      What services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      iOS 17

      Build environment

      System:
      OS: macOS 14.5
      CPU: (10) arm64 Apple M1 Max
      Memory: 103.30 MB / 32.00 GB
      Shell:
      version: "5.9"
      path: /bin/zsh
      Binaries:
      Node:
      version: 18.13.0
      path: ~/.nvm/versions/node/v18.13.0/bin/node
      Yarn:
      version: 1.18.0
      path: ~/.nvm/versions/node/v18.13.0/bin/yarn
      npm:
      version: 8.19.3
      path: ~/.nvm/versions/node/v18.13.0/bin/npm
      Watchman:
      version: 2024.01.22.00
      path: /opt/homebrew/bin/watchman
      Managers:
      CocoaPods:
      version: 1.14.3
      path: /Users/jshah/.rbenv/shims/pod
      SDKs:
      iOS SDK:
      Platforms:

      • DriverKit 23.2
      • iOS 17.2
      • macOS 14.2
      • tvOS 17.2
      • visionOS 1.0
      • watchOS 10.2
        Android SDK: Not Found
        IDEs:
        Android Studio: 2022.3 AI-223.8836.35.2231.10811636
        Xcode:
        version: 15.2/15C500b
        path: /usr/bin/xcodebuild
        Languages:
        Java:
        version: 17.0.11
        path: /usr/bin/javac
        Ruby:
        version: 3.3.0
        path: /Users/jshah/.rbenv/shims/ruby
        npmPackages:
        "@react-native-community/cli": Not Found
        react:
        installed: 18.2.0
        wanted: 18.2.0
        react-native:
        installed: 0.72.7
        wanted: 0.72.7
        react-native-macos: Not Found
        npmGlobalPackages:
        "react-native": Not Found
        Android:
        hermesEnabled: true
        newArchEnabled: false
        iOS:
        hermesEnabled: true
        newArchEnabled: false

      Cocoapods version

      1.14.3

            Assignee:
            kraen.hansen@mongodb.com Kræn Hansen
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: