realm / realm-core

Core database component for the Realm Mobile Database SDKs
https://realm.io
Apache License 2.0
1.02k stars 165 forks source link

Non-streaming upload progress should report an estimate of 1 upon completion of a client reset. #7952

Open sync-by-unito[bot] opened 3 months ago

sync-by-unito[bot] commented 3 months ago

When creating the test to verify the upload progress notifications during client reset, it was discovered that the non-streaming upload notification callback was called one time with an estimate of 0.0 and then expired if there were no local or remote changes during the client reset. (The complete test log file is attached.)

Realm.Sync.Client.Session - Connection[1:66b04de3babb71ca336e205b] Session[4]: Progress handler called, downloaded = 0, downloadable = 0, estimate = 1.0000, uploaded = 0, uploadable = 0, estimate = 1.0000, snapshot version = 20, query_version = 0
Realm - Streaming Progress Progress callback called xferred: 0, xferrable: 0, estimate: 1
Realm - Non-Streaming Progress Progress callback called xferred: 0, xferrable: 0, estimate: 0

Since the non-streaming callback is being expired with this call and the streaming progress notification reports an estimate of 1.0, it seems to be more consistent to report an estimate 1.0 for non-streaming progress notifications in this case.

sync-by-unito[bot] commented 3 months ago

➤ PM Bot commented:

Jira ticket: RCORE-2227

sync-by-unito[bot] commented 3 months ago

➤ michael-wb commented:

Since a progress report is not going to be issued at the end of a client reset with no local or recovered changes, then it is likely that no progress reports with a downloadable of 0 and downloaded of 0 will be issued, so this change is likely not needed.