SyncDownloadProgress

Provides realtime progress on how PowerSync is downloading rows.

This type reports progress by implementing ProgressWithOperations, meaning that the totalOperations, downloadedOperations and fraction getters are available on this instance. Additionally, it's possible to obtain the progress towards a specific priority only (instead of tracking progress for the entire download) by using untilPriority.

The reported progress always reflects the status towards the end of a sync iteration (after which a consistent snapshot of all buckets is available locally).

In rare cases (in particular, when a compacting operation takes place between syncs), it's possible for the returned numbers to be slightly inaccurate. For this reason, SyncDownloadProgress should be seen as an approximation of progress. The information returned is good enough to build progress bars, but not exact enough to track individual download counts.

Also note that data is downloaded in bulk, which means that individual counters are unlikely to be updated one-by-one.

Properties

Link copied to clipboard
open override val downloadedOperations: Int

How many operations, out of totalOperations, have already been downloaded.

Link copied to clipboard
open val fraction: Float

The relative amount of totalOperations to items in downloadedOperations, as a number between 0.0 and 1.0 (inclusive).

Link copied to clipboard
open override val totalOperations: Int

How many operations need to be downloaded in total for the current download to complete.

Functions

Link copied to clipboard

Returns download progress towards all data up until the specified priority being received.