Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/powersync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.5.2

- Refactor `waitForFirstSync()` to iterate through the stream and remove the use of a `Future`.
- Fix sync connection not immediately closed when calling `db.disconnect()` (#114).

## 1.5.1

- Adds a hasSynced flag to check if initial data has been synced.
Expand Down
9 changes: 3 additions & 6 deletions packages/powersync/lib/src/powersync_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,11 @@ class PowerSyncDatabase with SqliteQueries implements SqliteConnection {
if (currentStatus.hasSynced ?? false) {
return;
}
final completer = Completer<void>();
statusStream.listen((result) {
await for (final result in statusStream) {
if (result.hasSynced ?? false) {
completer.complete();
break;
}
});

return completer.future;
}
}

@override
Expand Down
2 changes: 1 addition & 1 deletion packages/powersync/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: powersync
version: 1.5.1
version: 1.5.2
homepage: https://powersync.com
repository: https://github.com/powersync-ja/powersync.dart
description: PowerSync Flutter SDK - keep PostgreSQL databases in sync with on-device SQLite databases.
Expand Down