Skip to content

Commit 740fc8d

Browse files
committed
Improve docs on downloaded fraction
1 parent 8271c2a commit 740fc8d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/powersync_core/lib/src/sync/sync_status.dart

+7-2
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ final class InternalSyncDownloadProgress extends ProgressWithOperations {
318318
/// Information about a progressing download.
319319
///
320320
/// This reports the `total` amount of operations to download, how many of them
321-
/// have alreaady been `completed` and finally a `fraction` indicating relative
322-
/// progress (as a number between `0.0` and `1.0`)
321+
/// have already been `completed` and finally a `fraction` indicating relative
322+
/// progress (as a number between `0.0` and `1.0`, inclusive)
323323
///
324324
/// To obtain these values, use [SyncDownloadProgress] available through
325325
/// [SyncStatus.downloadProgress].
@@ -335,6 +335,11 @@ final class ProgressWithOperations {
335335
ProgressWithOperations._(this.totalOperations, this.downloadedOperations);
336336

337337
/// Relative progress (as a number between `0.0` and `1.0`).
338+
///
339+
/// When this number reaches `1.0`, all changes have been received from the
340+
/// sync service. Actually applying these changes happens before the
341+
/// [SyncStatus.downloadProgress] flag is cleared though, so progress can stay
342+
/// at `1.0` for a short while before completing.
338343
double get downloadedFraction {
339344
return totalOperations == 0 ? 0.0 : downloadedOperations / totalOperations;
340345
}

0 commit comments

Comments
 (0)