-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Realm is not refreshed after sync session upload/download callback #5543
Comments
I think that's by design. |
If we had the option of awaiting a refresh asynchronously we could fix this on the dart side. |
It is by design...you can just manually call On multi-thread SDK's like Java, you cannot do that as it risk updating in the middle of a thread execution |
Also, it will blog my thread. We really need the async version. |
Couldn't you just use indefinite progresslisteners as a proxy for upload/download? And then call refresh when |
In my original comment, I meant we should file a ticket in the dart SDK. I don't believe Core can do anything about it because the sync client doesn't know which one is the "main thread" Realm to refresh it. It invokes the completion on its own thread and then it's up to the SDK or the framework to dispatch the continuation on the original Realm thread at which point Sync is no longer involved. Re: progress listeners - they have the same issue - they too originate from the sync thread, so there's no guarantee that when they're invoked, the main thread Realm has refreshed itself. Re: Kotlin's approach - as @nielsenko said, this is likely a bad idea because us calling |
Hi all, can you see if this behavior works as expected now? We fixed an issue related to bootstrap's not auto-refreshing properly here #5553 - it was released in v12.1.0 - and I'd like to see if that was the underlying cause of this issue too. |
@nielsenko - has this been resolved in v12.1.0? |
Sorry about the delay. I have tested with v12.1.0-36-g7b82fcf3 and yes my test is no longer dependent on calling an explicit refresh. |
When awaiting download/upload completion the realm is not refreshed after the callback fires. This can cause odd races, where the recently downloaded data is not available when reading the realm.
Originally posted by @nirinchev in realm/realm-dart#619 (comment)
The text was updated successfully, but these errors were encountered: