-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Extra instances of RCTBridge don't get instantiated when Realm is used #3522
Comments
Hm, it seems like Realm uses RCTBridge as any other native module 🤔 however, when I use other native modules, the extra RCTBridge instance still works well, it's only when I add Realm the things break. |
When adding Realm dependency, |
Hm, |
Oh, I see now. Realm doesn't support multithreading yet: #2117. Well, it was worth trying. |
Thank you for the comprehensive bug report. Although Realm JS might have an issue supporting this use-case, I would still expect that the library wouldn't interfere with the creation of multiple |
Closing this as it will be resolved with the support for Hermes and the Flipper debugger. Please see here to try it out and provide feedback. Thanks for your patience! |
@backmeupplz Was the issue resolved with @bmunkholm 's solution? |
Goals
I'm trying to create an extra RCTBridge instance in React Native to offload CPU-intensive tasks to a separate React Native instance. It works well, see this example I made.
Then I do
yarn add realm && npx pod-install
, which adds Realm to the project, and rebuild the app.Expected Results
Both the main React Native bridge and my separate new RCTBridge for the sync process are instantiated and work well.
Actual Results
All of a sudden only the first RCTBridge instance gets instantiated. The second one either never gets created or halts in a deadlock?
Steps to Reproduce
yarn && npx pod-install
yarn add realm && npx pod-install
AppDelegate.m
to verify that only the first instance of RCTBridge gets instantiatedCode Sample
https://github.com/backmeupplz/react-native-ios-threading-example
Version of Realm and Tooling
6.1.5
and10.1.3
, both have this issue0.63.3
and0.63.4
, both have the issueExtra info
In my particular case, I use React Native as the app that the user uses and a separate RCTBridge handles the synchronization logic between local Realm storage and my backend. But the example here is simplified to just show you the reproducible issue.
From what it seems like, Realm also creates its own RCTBridge instances and modifies the built-in RCTBridge logic?
Looks like this is an iOS-only issue, hence I only tested the above example on iOS.
The text was updated successfully, but these errors were encountered: