-
Notifications
You must be signed in to change notification settings - Fork 165
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
SyncSession::wait_for_upload_completion does not return error if session is invalid #5365
Comments
Does the callback return successfully or does just calling |
The callback never gets called. Problem is we can have users hang forever on fx. It gets logged, and an error is send back via callback/handler passed to This is less than stellar. In dart a minimal sample would look something like: realm.write(() {
realm.add(ARealmObject());
});
await realm.syncSession.waitForUpload(); where |
Sorry, if I might be on the wrong issue here. |
No, that is exactly the use case for Kotlin as well. |
It seems to me that it is either this:
or this:
That is causing the problem, we should probably just invoke the callback with some error code if no subscription is present. |
Note, it is for all errors, not just subscriptions, i.e. this also happens if the server sends a Client Reset |
➤ Jonathan Reams commented: I think this basically works-as-designed or is at least a forever bug/design flaw. Unless the user has been logged out, sync sessions are never "invalid" they are always active, or about to become active, and so if you are able to access a SyncSession to request download completion notifications, then it is not invalid and requesting a notification is an okay thing to do, even if that notification is going to be processed in the distant future. Maybe there's a bug specifically in how client resets work that is causing us to not fire download completions after the client reset is complete? In core version 12.1.0 we made it so doing a write on a table that does not have a subscription will throw an error before you commit, so the specific FLX case called out here should be mitigated by that. |
@jbreams I agree. This particular case is no longer a problem. |
➤ Jonathan Reams commented: [~christian.melchior@mongodb.com] is there more to do here? Is this a duplicate of RCORE-1001? |
➤ Jonathan Reams commented: It's been over a month since I asked whether this was a duplicate of RCORE-1001 and I never got a response, so I'm going to close this as a duplicate. If there's more work to do here that isn't covered by RCORE-1001, please reach out and re-open. |
While trying to write some unit tests for Kotlin around waiting for upload and download I discovered something that looks like a bug.
SyncSession: wait_for_upload_completion
andSyncSession::wait_for_download_completion
Expected result: I would expect the function to return some kind of error_code in the callback we provide.
Actual result: It returns succesfully.
The text was updated successfully, but these errors were encountered: