-
Type: Improvement
-
Resolution: Incomplete
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
With version 1.5.0 of the realm kotlin sdk, when using partial sync, SubscriptionSet::waitForSynchronization seems to have some unintended behavior:
The objects are not returned in the corresponding query until the timeout is reached.
So if waitForSynchronization(10.seconds) is used, the objects will be returned after 10 seconds. If waitForSynchronization is used without any arguments, they never return (because the default value is Duration.INFINITE).
Example:
val subscriptions = realm.subscriptions
val query = realm.query(MyClass::class)
subscriptions.update {
add(query)
}
subscriptions.waitForSynchronization(10.seconds)
query.asFlow().collect {
// This is not called with the result set until 10 seconds have passed
}