Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-706

SubscriptionSet::waitForSynchronization doesn't seem to work properly

      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
      }
      

            Assignee:
            christian.melchior@mongodb.com Christian Melchior (Inactive)
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: