Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-2099

Regression with missing download progress notification for PBS

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Expected results

      Progress notifications for PSB seems to have changed when there is currently no known outstanding downloads.

      In 14.5.1 and below it was possible to implement a quite simple "progress spinner"-experience with code like

      val realm = Realm.open(...)
      realm.syncSession.progressAsFlow(Direction.DOWNLOAD, ProgressMode.CURRENT_CHANGES)
          .onEach {
              // Display progress
          }
          .takeWhile { !it.isTransferComplete }
      
      // Display downloaded content
      

      If there were no remote updates since the app was opened last time, the progress notifier would fire an immediate event with transferableBytes == transferredBytes indicating that there was no immediate known ongoing download, and you could proceed to displaying the data.

      The new behavior is not only a regression, but also seems to go against all other notifier registration points that actually posts an immediate callback of the initial state.

      Actual Results

      With v14.5.2-39-geef7fcf04 we are no longer getting a progress notification if all known things have been fully downloaded, so
      neither

      realm.syncSession.progressAsFlow(Direction.DOWNLOAD, ProgressMode.CURRENT_CHANGES)
      

      nor

      realm.syncSession.progressAsFlow(Direction.DOWNLOAD, ProgressMode.INDEFINITELY)
      

      The actual tests showing the regression in Kotlin was https://github.com/realm/realm-kotlin/blob/main/packages/test-sync/src/commonTest/kotlin/io/realm/kotlin/test/mongodb/common/ProgressListenerTests.kt#L228.

      Steps & Code to Reproduce

      This Kotlin test is now failling with a timeout exception due to the missing callbacks.

      Core version

      Core version: v14.5.2-39-geef7fcf04

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: