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
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2025-01-16

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.11.1`](#powersync---v1111)
- [`powersync_sqlcipher` - `v0.1.3`](#powersync_sqlcipher---v013)

---

#### `powersync` - `v1.11.1`

- Fix `statusStream` emitting the same sync status multiple times.

#### `powersync_sqlcipher` - `v0.1.3`

- Fix `statusStream` emitting the same sync status multiple times.


## 2025-01-06

### Changes
Expand Down
2 changes: 1 addition & 1 deletion demos/benchmarks/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
2 changes: 1 addition & 1 deletion demos/django-todolist/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
2 changes: 1 addition & 1 deletion demos/firebase-nodejs-todolist/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-anonymous-auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
supabase_flutter: ^2.0.2
path: ^1.8.3
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-edge-function-auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
supabase_flutter: ^2.0.2
path: ^1.8.3
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-simple-chat/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies:

supabase_flutter: ^2.0.2
timeago: ^3.6.0
powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-todolist-drift/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter
powersync_attachments_helper: ^0.6.17
powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-todolist-optional-sync/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-todolist/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter
powersync_attachments_helper: ^0.6.17
powersync: ^1.11.0
powersync: ^1.11.1
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
4 changes: 4 additions & 0 deletions packages/powersync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.11.1

- Fix `statusStream` emitting the same sync status multiple times.

## 1.11.0

- Increase limit on number of columns per table to 1999.
Expand Down
4 changes: 2 additions & 2 deletions packages/powersync/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: powersync
version: 1.11.0
version: 1.11.1
homepage: https://powersync.com
repository: https://github.com/powersync-ja/powersync.dart
description: PowerSync Flutter SDK - sync engine for building local-first apps.
Expand All @@ -11,7 +11,7 @@ dependencies:
sdk: flutter

sqlite3_flutter_libs: ^0.5.23
powersync_core: ^1.1.0
powersync_core: ^1.1.1
powersync_flutter_libs: ^0.4.4
collection: ^1.17.0
pubspec_parse: ^1.3.0
Expand Down
4 changes: 4 additions & 0 deletions packages/powersync_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.1

- Fix `statusStream` emitting the same sync status multiple times.

## 1.1.0

- Increase limit on number of columns per table to 1999.
Expand Down
17 changes: 12 additions & 5 deletions packages/powersync_core/lib/src/database/powersync_db_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,23 @@ mixin PowerSyncDatabaseMixin implements SqliteConnection {
}

@protected
@visibleForTesting
void setStatus(SyncStatus status) {
if (status != currentStatus) {
currentStatus = status.copyWith(
// Note that currently the streaming sync implementation will never set hasSynced.
// lastSyncedAt implies that syncing has completed at some point (hasSynced = true).
// The previous values of hasSynced should be preserved here.
// Note that currently the streaming sync implementation will never set hasSynced.
// lastSyncedAt implies that syncing has completed at some point (hasSynced = true).
// The previous values of hasSynced should be preserved here.
final newStatus = status.copyWith(
hasSynced: status.lastSyncedAt != null
? true
: status.hasSynced ?? currentStatus.hasSynced,
lastSyncedAt: status.lastSyncedAt ?? currentStatus.lastSyncedAt);
statusStreamController.add(currentStatus);
// If the absence of hasSync was the only difference, the new states would be equal
// and don't require an event. So, check again.
if (newStatus != currentStatus) {
currentStatus = newStatus;
statusStreamController.add(currentStatus);
}
}
}

Expand All @@ -181,6 +187,7 @@ mixin PowerSyncDatabaseMixin implements SqliteConnection {
await disconnect();
// Now we can close the database
await database.close();
await statusStreamController.close();
}

/// Connect to the PowerSync service, and keep the databases in sync.
Expand Down
2 changes: 1 addition & 1 deletion packages/powersync_core/lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const String libraryVersion = '1.1.0';
const String libraryVersion = '1.1.1';
2 changes: 1 addition & 1 deletion packages/powersync_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: powersync_core
version: 1.1.0
version: 1.1.1
homepage: https://powersync.com
repository: https://github.com/powersync-ja/powersync.dart
description: PowerSync Dart SDK - sync engine for building local-first apps.
Expand Down
23 changes: 23 additions & 0 deletions packages/powersync_core/test/powersync_shared_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:powersync_core/powersync_core.dart';
import 'package:sqlite_async/mutex.dart';
import 'package:test/test.dart';
import 'package:uuid/parsing.dart';
Expand Down Expand Up @@ -89,5 +90,27 @@ void main() {
// Check that it is a valid uuid
UuidParsing.parseAsByteList(id);
});

test('does not emit duplicate sync status events', () async {
final db = await testUtils.setupPowerSync(path: path);
expectLater(
db.statusStream,
emitsInOrder(
[
// Manual setStatus call. hasSynced set to true because lastSyncedAt is set
isA<SyncStatus>().having((e) => e.hasSynced, 'hasSynced', true),
// Closing the database emits a disconnected status
isA<SyncStatus>().having((e) => e.connected, 'connected', false),
emitsDone
],
),
);

final status = SyncStatus(connected: true, lastSyncedAt: DateTime.now());
db.setStatus(status);
db.setStatus(status); // Should not re-emit!

await db.close();
});
});
}
4 changes: 4 additions & 0 deletions packages/powersync_sqlcipher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.3

- Fix `statusStream` emitting the same sync status multiple times.

## 0.1.2

- Increase limit on number of columns per table to 1999.
Expand Down
4 changes: 2 additions & 2 deletions packages/powersync_sqlcipher/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: powersync_sqlcipher
version: 0.1.2
version: 0.1.3
homepage: https://powersync.com
repository: https://github.com/powersync-ja/powersync.dart
description: PowerSync Flutter SDK - sync engine for building local-first apps.
Expand All @@ -12,7 +12,7 @@ dependencies:
flutter:
sdk: flutter

powersync_core: ^1.1.0
powersync_core: ^1.1.1
powersync_flutter_libs: ^0.4.4
sqlcipher_flutter_libs: ^0.6.4
dev_dependencies:
Expand Down
Loading