-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Imagine a case where you have a read only Realm on the server.
Right now this requires something like this:
SyncConfiguration config = user.createConfiguration() .fullSynchronization() .readOnly() .waitForInitialRemoteData() .build(); Realm.getInstanceAsync(config, callback);
Unfortunately, the callback approach makes code logic rather hard to handle.
Especially since a normal flow is to have some sort of login screen that handles asynchronously downloading the Realm with progress bars and then the rest of the app assumes the Realm file is there.
We should look into ways for improving the API's in this case, so that you can synchronously open an existing Realm even if waitForInitialRemoteData() was set on the configuration.
The issue is probably that the checks for waitForInitialRemoteData() and UI thread are done before we even start looking into the file existing or not.
Alternatively, we need to allow multiple different configurations opening the same Realm.
This needs some thought.