CBLite 1.4.4 - iOS - Replication Document Count Progress Broken

Client: iOS CouchbaseLite 1.4.4
Sync Gateway: 1.5.x
Network: Wifi

I am pull replicating a very large database. I would like to implement progress UI using the following API:

CBReplication -> completedChangesCount./ changesCount

However when I run the replication the changesCount is constant. It starts out very low and slowly increases to a number slightly higher then the completedChangesCount. Its not possible to report progress the replicator keeps increasing the number of total documents in the replication. Is this a bug or incomplete implementation? It would be incredibly useful to report determinate progress to the users during large data replications. But since the completeCount is not constant I cannot accurately do so.

Regards

It’s surprisingly difficult to provide useful progress info. We’ve been struggling with this off and on for years. The key problem is that accurate progress means determining changesCount at the start of the replication, yet this value is expensive to compute; it can involve significant disk and network I/O. And much of that I/O would have to be repeated later when actually transferring the revisions. So to give you accurate progress info we’d have to sacrifice both performance and latency.

(We’re not the only ones running into this sort of problem. I always notice that the build progress bar in Xcode is similarly uninformative. And the macOS Finder does provide semi-accurate progress during folder copies, but only at the expense of spending a while traversing the directory hierarchy before it starts.)