question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Realm.open() hangs on Android

See original GitHub issue

EDIT: 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:

https://github.com/realm/realm-js/blob/416632c9adc7350cdca12dc792edcf3e9d0b30d8/lib/extensions.js#L47

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:25 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Talor-Acommented, Oct 12, 2017

I’m able to reproduce this as well, on android the first app load works, but reloading JS code makes realm.open never resolve.

1reaction
ashwinphatakcommented, Sep 12, 2017

I’m able to reproduce the issue and indeed the callback to _waitForDownload never gets called.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found