Skip to content

Commit 9fe1e74

Browse files
committed
Improve docs for connection states.
1 parent faec16c commit 9fe1e74

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

packages/powersync/lib/src/sync_status.dart

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11
class SyncStatus {
2-
/// true if currently connected
2+
/// true if currently connected.
3+
///
4+
/// This means the PowerSync connection is ready to download, and
5+
/// [PowerSyncBackendConnector.uploadData] may be called for any local changes.
36
final bool connected;
47

5-
/// true if currently connected
8+
/// true if the PowerSync connection is busy connecting.
9+
///
10+
/// During this stage, [PowerSyncBackendConnector.uploadData] may already be called,
11+
/// called, and [uploading] may be true.
612
final bool connecting;
713

8-
/// true if downloading changes
14+
/// true if actively downloading changes.
15+
///
16+
/// This is only true when [connected] is also true.
917
final bool downloading;
1018

1119
/// true if uploading changes
1220
final bool uploading;
1321

14-
/// Time that a last sync has fully completed, if any
15-
/// Currently this is reset to null after a restart
22+
/// Time that a last sync has fully completed, if any.
23+
///
24+
/// Currently this is reset to null after a restart.
1625
final DateTime? lastSyncedAt;
1726

1827
/// Error during uploading.
28+
///
1929
/// Cleared on the next successful upload.
2030
final Object? uploadError;
2131

2232
/// Error during downloading (including connecting).
33+
///
2334
/// Cleared on the next successful data download.
2435
final Object? downloadError;
2536

0 commit comments

Comments
 (0)