ProgressNotification callback not triggered without an initial download in Realm 10

103 views Asked by At

We are using MongoDB Realm in our app.

The first time the user is connected to the app, the ProgressNotifcation callback is triggered correctly, and it will work and trigger whenever a new download is coming. Even if no download is pending, the ProgressNotification callback will be triggered (the Progress object pass in the callback will contain values from the last download) at least once(when creating it). I supposed this is due to the fact that we are downloading the first data set of the user.

But after killing the app and launching it again, the ProgressNotification callback is not triggered anymore until new data are received by the app. And from this point, the callback will be called every time we need it.

It seems that now, the framework needs a first download since the app is launch to make ProgressNotification callback to be triggered every time we need it.

This was working in the previous version of Realm (5.X.X). We just finished the migration to Realm 10 and discover this issue. I am a bit stuck here, do not know if this is an intended change or a bug on my part. But I am pretty sure this was working in the previous version of the SDK.

Can anyone help me with this? Thanks

Note: this is no more working in both mode : .forCurrentlyOutstandingWork and .reportIndefinitely

Example

self.token = syncSession.addProgressNotification(for: .download, mode: .forCurrentlyOutstandingWork) { progress in
                           .......Some code........   <- this part of the code is not triggered anymore
}

EDIT - 21/12/2020

For clarification, the token returned contains a value and the .invalidate is not being called.

There is no error in the session and any new download is triggering the callback. After an initial download, everything works as expected. This means that when I add a progressNotifcation later on, the callback is triggered immediately with the progress of the previous download. But if there is not an initial download, the callback is never called.

For the scope, this method is actually in the custom publisher that I created and it is not deallocated.

Realm 10.5.0

iOS 14.3

0

There are 0 answers