realm-java icon indicating copy to clipboard operation
realm-java copied to clipboard

impossible to get progress notification with readOnly database at the first time

Open idok595 opened this issue 9 years ago • 4 comments

when trying to open readOnly realm at the first time it is require to waitForInitialRemoteData(), the only way to work with such config is to getInstanseAsync, when i am trying to work with this method and adding Progress lisetener i am getting error "Cannot register a progress listener before a session is created. A session will be created after the first call to Realm.getInstance()" even if i do that after call to getInstanseAsync, if i will call getInstanse() i will block the ui thread so i will never be able to add the progress notification.

Realm Version: 3.4.0

idok595 avatar Jun 25 '17 08:06 idok595

Yes, this is tied to the fact that currently a Session is tied to the Realm lifecycle. We want to decouple this for other reasons, in which case this will be possible.

cmelchior avatar Jun 25 '17 13:06 cmelchior

this is a design bug, the first time of downloading the database is the must important one, this is the only case that the app must to delay the user.

idok595 avatar Jun 25 '17 14:06 idok595

@idok595 It is currently labeled "Blocked" as we need to coordinate with the other SDKs.

kneth avatar Jun 27 '17 07:06 kneth

This has been fixed in Realm Java 6.0.2

cmelchior avatar Nov 27 '19 21:11 cmelchior