Uploaded image for project: 'Realm Java SDK'
  1. Realm Java SDK
  2. RJAVA-617

Download progress listeners report wrong numbers

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

      In some cases the download progress listeners never reach a point where `downloaded == downloadble` which can break a lot of client-side logic using that to determine when upload or download is complete.

      One example 

      2020-05-11 12:47:10.135 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Progress handler called, downloaded = 0, downloadable(total) = 0, uploaded = 0, uploadable = 131, reliable_download_progress = 0, snapshot version = 2
      2020-05-11 12:47:10.135 28945-29025/io.realm.test I/REALM_SYNC: Connection[4]: Connected to endpoint '127.0.0.1:9090' (from '127.0.0.1:50724')
      2020-05-11 12:47:10.136 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: WebSocket::initiate_client_handshake()
      2020-05-11 12:47:10.159 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: WebSocket::handle_http_response_received()
      2020-05-11 12:47:10.159 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Negotiated protocol version: 1
      2020-05-11 12:47:10.159 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Will emit a ping in 53830 milliseconds
      2020-05-11 12:47:10.159 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Sending: BIND(path='"9c0e3d7a-a337-4740-899f-8a407d21f869"', signed_user_token_size=695, need_client_file_ident=1, is_subserver=0)
      2020-05-11 12:47:10.170 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Received: IDENT(client_file_ident=17, client_file_ident_salt=4155555971344219390)
      2020-05-11 12:47:10.172 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Sending: IDENT(client_file_ident=17, client_file_ident_salt=4155555971344219390, scan_server_version=0, scan_client_version=0, latest_server_version=0, latest_server_version_salt=0)
      2020-05-11 12:47:10.172 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Sending: MARK(request_ident=1)
      2020-05-11 12:47:10.180 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Received: DOWNLOAD(download_server_version=2, download_client_version=0, latest_server_version=2, latest_server_version_salt=8412427211269738421, upload_client_version=0, upload_server_version=0, downloadable_bytes=623, num_changesets=2, ...)
      2020-05-11 12:47:10.181 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Finished changeset indexing (incoming: 2 changeset(s) / 28 instructions, local: 1 changeset(s) / 8 instructions, conflict group(s): 12)
      2020-05-11 12:47:10.181 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Finished transforming 1 local changesets through 2 incoming changesets (8 vs 28 instructions, in 12 conflict groups)
      2020-05-11 12:47:10.187 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: 2 remote changesets integrated, producing client version 4
      2020-05-11 12:47:10.187 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Progress handler called, downloaded = 575, downloadable(total) = 1198, uploaded = 0, uploadable = 131, reliable_download_progress = 1, snapshot version = 4
      2020-05-11 12:47:17.387 28945-29025/io.realm.test E/REALM_JAVA: From native: Progress{transferredBytes=575, transferableBytes=1198}
      2020-05-11 12:47:20.649 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Received: MARK(request_ident=1)
      2020-05-11 12:47:20.651 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Sending: UPLOAD(progress_client_version=4, progress_server_version=2, locked_server_version=2, num_changesets=1)
      2020-05-11 12:47:20.652 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Upload compaction: original size = 131, compacted size = 131
      2020-05-11 12:47:20.740 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Received: DOWNLOAD(download_server_version=3, download_client_version=2, latest_server_version=3, latest_server_version_salt=5140446775280041719, upload_client_version=4, upload_server_version=2, downloadable_bytes=645, num_changesets=0, ...)
      2020-05-11 12:47:20.745 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Sending: UPLOAD(progress_client_version=5, progress_server_version=3, locked_server_version=3, num_changesets=0)
      2020-05-11 12:47:20.745 28945-29025/io.realm.test D/REALM_SYNC: Connection[4]: Session[4]: Progress handler called, downloaded = 575, downloadable(total) = 1220, uploaded = 131, uploadable = 131, reliable_download_progress = 1, snapshot version = 5
      2020-05-11 12:47:25.964 28945-29025/io.realm.test E/REALM_JAVA: From native: Progress{transferredBytes=575, transferableBytes=1198}
      

      Blocked by https://jira.mongodb.org/browse/REALMC-5354

            Assignee:
            Unassigned Unassigned
            Reporter:
            christian.melchior@mongodb.com Christian Melchior (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: