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

Realm lock threads with two bundle applications

    • 3 - M (<= 1 month)
    • Differentiators
    • 1214
    • Needed
    • Please add information to this field.

      I have two bundles running simultaneously in the react-native, having the following structure:

      • RCTRootView
        • UIView
          • RCTRootView

      When this view structure is applied, realm starts the new thread successfully in the first RCTRootView.
      When the second thread will start with the second RCTRootView, the code that checks if the thread is finished goes into loops, locking the main thread and blocking the bundle loading.

      It has been verified that the code that is causing this problem is in the class:
      From issue #1065 implementation.
      RealmReact.mm - 275 until 285 - below:

      Unable to find source-code formatter for language: objective. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      void _initializeOnJSThread(JSContextRefExtractor jsContextExtractor) {
          // Make sure the previous JS thread is completely finished before continuing.
          static __weak NSThread *s_currentJSThread;
          while (s_currentJSThread && !s_currentJSThread.finished) {
              [NSThread sleepForTimeInterval:0.1];
          }
          s_currentJSThread = [NSThread currentThread];
      
          // Close all cached Realms from the previous JS thread.
          realm::_impl::RealmCoordinator::clear_all_caches();
      
          RJSInitializeInContext(jsContextExtractor());
      }
      

      Version of Realm and Tooling

      • Realm JS SDK Version: 1.10.0
      • React Nattive: 0.41.2
      • Client OS & Version: Mac OS 10.12.6

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: