Realm.open() hangs on Android
See original GitHub issueEDIT: This also happens after reloading the emulator on React Native, in a very simple setup (see below https://github.com/realm/realm-js/issues/1248#issuecomment-328313637)
Goals
Get an error message when opening a synced realm if server not available or user is offline.
Expected Results
Realm.open() returns a promise that gets rejected with useful error message.
Actual Results
The promise simply stays in pending status indefinitely.
This callback does not get called:
Hence the promise never returns.
Steps to Reproduce
Run this code after log in with valid user:
const openRealm = (user, url, schema) => {
return Realm.open({
sync: { user, url },
schema,
schemaVersion: 1
});
};
Version of Realm and Tooling
- Realm JS SDK Version: 1.10.3
- React Native: 0.44.3
- Which debugger for React Native: None
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:25 (10 by maintainers)
Top Results From Across the Web
App is crashing one time before the realm data loads
This is the code that crashes my app, just on the first time it is opened. const formsResult = useQuery(Form); // ... other...
Read more >Realm: create causing a crash within android (react-native)
The example below is working fine while in debug is enabled using React Native Debugger but the app is crashing in normal ...
Read more >Sudden crash on launch from all TestFlight builds
The app runs fine under Xcode on an iPad connected by wire to my MacBook. When we publish the app in TestFlight, it...
Read more >Realm Database on Android: Getting Started
Each entity must be a RealmObject() . Create a class in the realm package and name it OwnerRealm.kt. Add the following code: open...
Read more >Build an Offline-First React Native Mobile App with Expo and ...
The React Native Project, allows you to create iOS and Android apps using ... But first, we need to open a Realm to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m able to reproduce this as well, on android the first app load works, but reloading JS code makes
realm.opennever resolve.I’m able to reproduce the issue and indeed the callback to
_waitForDownloadnever gets called.