I have implemented a query-based sync (reference) realm in the cloud ROS and loaded it with several hundred thousand objects via a Nodejs app.
Next, I have a React Native app which opens the Realm using the synchronous method:
const realm = new Realm(config)
I understand that this means the first time the app opens I will have nothing in my local app instance. Therefore, I immediately access a subsegment of the records for the user and subscribe to them:
const results = realm.objects('Property').filtered('zip = "75074"'); const subscription = results.subscribe();
I also add listeners to the results and the subscription objects to get status updates and a listener to realm.syncSession.addProgressNotification(…) to get download stats.
Things seem to work in a reasonable way when I first open the app, it appears to begin downloading the (~30mb) of data from cloud ROS and I can then query against this data on the app.
Now, my expectation is that I should be able to close (swipe up on iOS) the app on my device and re-open it and as long as I am subscribing to the same data, it should already be cached on my local device. However, what I do observe is that every restart of the app looks exactly the same and I have to wait for the entire dataset to get downloaded.
Am I not understanding the architecture correctly?