Skip to content

Commit 9f673bf

Browse files
committed
Merge branch 'main' into sync-progress
2 parents 740fc8d + 83b82c9 commit 9f673bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+974
-642
lines changed

CHANGELOG.md

+68
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,74 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## 2025-04-24
7+
8+
### Changes
9+
10+
---
11+
12+
Packages with breaking changes:
13+
14+
- There are no breaking changes in this release.
15+
16+
Packages with other changes:
17+
18+
- [`powersync_core` - `v1.2.4`](#powersync_core---v124)
19+
- [`powersync_attachments_helper` - `v0.6.18+6`](#powersync_attachments_helper---v06186)
20+
- [`powersync_sqlcipher` - `v0.1.5+4`](#powersync_sqlcipher---v0154)
21+
- [`powersync` - `v1.12.4`](#powersync---v1124)
22+
23+
Packages with dependency updates only:
24+
25+
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
26+
27+
- `powersync_attachments_helper` - `v0.6.18+6`
28+
- `powersync_sqlcipher` - `v0.1.5+4`
29+
- `powersync` - `v1.12.4`
30+
31+
---
32+
33+
#### `powersync_core` - `v1.2.4`
34+
35+
- Fix deadlock when `connect()` is called immediately after opening a database.
36+
37+
38+
## 2025-04-22
39+
40+
### Changes
41+
42+
---
43+
44+
Packages with breaking changes:
45+
46+
- There are no breaking changes in this release.
47+
48+
Packages with other changes:
49+
50+
- [`powersync_core` - `v1.2.3`](#powersync_core---v123)
51+
- [`powersync_attachments_helper` - `v0.6.18+5`](#powersync_attachments_helper---v06185)
52+
- [`powersync_sqlcipher` - `v0.1.5+3`](#powersync_sqlcipher---v0153)
53+
- [`powersync` - `v1.12.3`](#powersync---v1123)
54+
55+
Packages with dependency updates only:
56+
57+
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
58+
59+
- `powersync_attachments_helper` - `v0.6.18+5`
60+
- `powersync_sqlcipher` - `v0.1.5+3`
61+
- `powersync` - `v1.12.3`
62+
63+
---
64+
65+
#### `powersync_core` - `v1.2.3`
66+
67+
- Introduce locks to avoid duplicate sync streams when multiple instances of the same database are opened.
68+
- Refactor connect / disconnect internally.
69+
- Warn when multiple instances of the same database are opened.
70+
- Fix race condition causing data not to be applied while an upload is in progress.
71+
- Web: Fix token invalidation logic when a sync worker is used.
72+
73+
674
## 2025-03-11
775

876
### Changes

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ _[PowerSync](https://www.powersync.com) is a sync engine for building local-firs
66

77
# PowerSync SDK for Dart and Flutter
88

9-
| package | build | pub | likes | popularity | pub points |
10-
| -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
11-
| [powersync](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/packages.yml/badge.svg?branch=master)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync.svg)](https://pub.dev/packages/powersync) | [![likes](https://img.shields.io/pub/likes/powersync?logo=dart)](https://pub.dev/packages/powersync/score) | [![popularity](https://img.shields.io/pub/popularity/powersync?logo=dart)](https://pub.dev/packages/powersync/score) | [![pub points](https://img.shields.io/pub/points/powersync?logo=dart)](https://pub.dev/packages/powersync/score) |
12-
| [powersync_core](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync_core) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/packages.yml/badge.svg?branch=master)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync_core.svg)](https://pub.dev/packages/powersync_core) | [![likes](https://img.shields.io/pub/likes/powersync_core?logo=dart)](https://pub.dev/packages/powersync_core/score) | [![popularity](https://img.shields.io/pub/popularity/powersync_core?logo=dart)](https://pub.dev/packages/powersync_core/score) | [![pub points](https://img.shields.io/pub/points/powersync_core?logo=dart)](https://pub.dev/packages/powersync_core/score) |
13-
| [powersync_sqlcipher](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync_sqlcipher) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/packages.yml/badge.svg?branch=master)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync_sqlcipher.svg)](https://pub.dev/packages/powersync_sqlcipher) | [![likes](https://img.shields.io/pub/likes/powersync_sqlcipher?logo=dart)](https://pub.dev/packages/powersync_sqlcipher/score) | [![popularity](https://img.shields.io/pub/popularity/powersync_sqlcipher?logo=dart)](https://pub.dev/packages/powersync_sqlcipher/score) | [![pub points](https://img.shields.io/pub/points/powersync_sqlcipher?logo=dart)](https://pub.dev/packages/powersync_sqlcipher/score) |
14-
| [powersync_attachments_helper](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync_attachments_helper) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/packages.yml/badge.svg?branch=master)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync_attachments_helper.svg)](https://pub.dev/packages/powersync_attachments_helper) | [![likes](https://img.shields.io/pub/likes/powersync_attachments_helper?logo=dart)](https://pub.dev/packages/powersync_attachments_helper/score) | [![popularity](https://img.shields.io/pub/popularity/powersync_attachments_helper?logo=dart)](https://pub.dev/packages/powersync_attachments_helper/score) | [![pub points](https://img.shields.io/pub/points/powersync_attachments_helper?logo=dart)](https://pub.dev/packages/powersync_attachments_helper/score) |
15-
| [powersync_flutter_libs](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync_flutter_libs) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/packages.yml/badge.svg?branch=master)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync_flutter_libs.svg)](https://pub.dev/packages/powersync_flutter_libs) | [![likes](https://img.shields.io/pub/likes/powersync_flutter_libs?logo=dart)](https://pub.dev/packages/powersync_flutter_libs/score) | [![popularity](https://img.shields.io/pub/popularity/powersync_flutter_libs?logo=dart)](https://pub.dev/packages/powersync_flutter_libs/score) | [![pub points](https://img.shields.io/pub/points/powersync_flutter_libs?logo=dart)](https://pub.dev/packages/powersync_flutter_libs/score) |
9+
| package | build | pub | likes | pub points |
10+
|--------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
11+
| [powersync](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/check.yml/badge.svg?branch=main)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync.svg)](https://pub.dev/packages/powersync) | [![likes](https://img.shields.io/pub/likes/powersync?logo=dart)](https://pub.dev/packages/powersync/score) | [![pub points](https://img.shields.io/pub/points/powersync?logo=dart)](https://pub.dev/packages/powersync/score) |
12+
| [powersync_core](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync_core) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/check.yml/badge.svg?branch=main)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync_core.svg)](https://pub.dev/packages/powersync_core) | [![likes](https://img.shields.io/pub/likes/powersync_core?logo=dart)](https://pub.dev/packages/powersync_core/score) | [![pub points](https://img.shields.io/pub/points/powersync_core?logo=dart)](https://pub.dev/packages/powersync_core/score) |
13+
| [powersync_sqlcipher](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync_sqlcipher) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/check.yml/badge.svg?branch=main)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync_sqlcipher.svg)](https://pub.dev/packages/powersync_sqlcipher) | [![likes](https://img.shields.io/pub/likes/powersync_sqlcipher?logo=dart)](https://pub.dev/packages/powersync_sqlcipher/score) | [![pub points](https://img.shields.io/pub/points/powersync_sqlcipher?logo=dart)](https://pub.dev/packages/powersync_sqlcipher/score) |
14+
| [powersync_attachments_helper](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync_attachments_helper) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/check.yml/badge.svg?branch=main)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync_attachments_helper.svg)](https://pub.dev/packages/powersync_attachments_helper) | [![likes](https://img.shields.io/pub/likes/powersync_attachments_helper?logo=dart)](https://pub.dev/packages/powersync_attachments_helper/score) | [![pub points](https://img.shields.io/pub/points/powersync_attachments_helper?logo=dart)](https://pub.dev/packages/powersync_attachments_helper/score) |
15+
| [powersync_flutter_libs](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync_flutter_libs) | [![build](https://github.com/powersync-ja/powersync.dart/actions/workflows/check.yml/badge.svg?branch=main)](https://github.com/powersync-ja/powersync.dart/actions?query=workflow%3Apackages) | [![pub package](https://img.shields.io/pub/v/powersync_flutter_libs.svg)](https://pub.dev/packages/powersync_flutter_libs) | [![likes](https://img.shields.io/pub/likes/powersync_flutter_libs?logo=dart)](https://pub.dev/packages/powersync_flutter_libs/score) | [![pub points](https://img.shields.io/pub/points/powersync_flutter_libs?logo=dart)](https://pub.dev/packages/powersync_flutter_libs/score) |
1616

1717
#### Usage
1818

1919
This monorepo uses [melos](https://melos.invertase.dev/) to handle command and package management.
2020

21-
For detailed usage, check out the inner [powersync](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync), [powersync_core](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync_core), [powersync_sqlcipher](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync_sqlcipher) and [attachments helper](https://github.com/powersync-ja/powersync.dart/tree/master/packages/powersync_attachments_helper) packages.
21+
For detailed usage, check out the inner [powersync](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync), [powersync_core](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync_core), [powersync_sqlcipher](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync_sqlcipher) and [attachments helper](https://github.com/powersync-ja/powersync.dart/tree/main/packages/powersync_attachments_helper) packages.
2222

2323
To configure the monorepo for development run `melos prepare` after cloning
2424

demos/benchmarks/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ environment:
1010
dependencies:
1111
flutter:
1212
sdk: flutter
13-
powersync: ^1.12.2
13+
powersync: ^1.12.4
1414
path_provider: ^2.1.1
1515
path: ^1.8.3
1616
logging: ^1.2.0

demos/django-todolist/lib/main.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const listsPage = ListsPage();
4141
const homePage = listsPage;
4242

4343
const sqlConsolePage = Scaffold(
44-
appBar: StatusAppBar(title: 'SQL Console'),
44+
appBar: StatusAppBar(title: Text('SQL Console')),
4545
body: QueryWidget(defaultQuery: defaultQuery));
4646

4747
const loginPage = LoginPage();
@@ -76,7 +76,7 @@ class MyHomePage extends StatelessWidget {
7676
@override
7777
Widget build(BuildContext context) {
7878
return Scaffold(
79-
appBar: StatusAppBar(title: title),
79+
appBar: StatusAppBar(title: Text(title)),
8080
body: Center(child: content),
8181
floatingActionButton: floatingActionButton,
8282
drawer: Drawer(

demos/django-todolist/lib/widgets/status_app_bar.dart

+25-45
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,42 @@
1-
import 'dart:async';
2-
31
import 'package:flutter/foundation.dart';
42
import 'package:flutter/material.dart';
53
import 'package:powersync/powersync.dart';
64
import 'package:powersync_django_todolist_demo/widgets/fts_search_delegate.dart';
75
import '../powersync.dart';
86

9-
class StatusAppBar extends StatefulWidget implements PreferredSizeWidget {
10-
const StatusAppBar({super.key, required this.title});
11-
12-
final String title;
7+
class StatusAppBar extends StatelessWidget implements PreferredSizeWidget {
8+
final Widget title;
139

14-
@override
15-
State<StatusAppBar> createState() => _StatusAppBarState();
10+
const StatusAppBar({super.key, required this.title});
1611

1712
@override
1813
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
19-
}
20-
21-
class _StatusAppBarState extends State<StatusAppBar> {
22-
late SyncStatus _connectionState;
23-
StreamSubscription<SyncStatus>? _syncStatusSubscription;
24-
25-
@override
26-
void initState() {
27-
super.initState();
28-
_connectionState = db.currentStatus;
29-
_syncStatusSubscription = db.statusStream.listen((event) {
30-
setState(() {
31-
_connectionState = db.currentStatus;
32-
});
33-
});
34-
}
35-
36-
@override
37-
void dispose() {
38-
super.dispose();
39-
_syncStatusSubscription?.cancel();
40-
}
4114

4215
@override
4316
Widget build(BuildContext context) {
44-
final statusIcon = _getStatusIcon(_connectionState);
17+
return StreamBuilder(
18+
stream: db.statusStream,
19+
initialData: db.currentStatus,
20+
builder: (context, snapshot) {
21+
final status = snapshot.data!;
22+
final statusIcon = _getStatusIcon(status);
4523

46-
return AppBar(
47-
title: Text(widget.title),
48-
actions: <Widget>[
49-
IconButton(
50-
onPressed: () {
51-
showSearch(context: context, delegate: FtsSearchDelegate());
52-
},
53-
icon: const Icon(Icons.search),
54-
),
55-
statusIcon,
56-
// Make some space for the "Debug" banner, so that the status
57-
// icon isn't hidden
58-
if (kDebugMode) _makeIcon('Debug mode', Icons.developer_mode),
59-
],
24+
return AppBar(
25+
title: title,
26+
actions: <Widget>[
27+
IconButton(
28+
onPressed: () {
29+
showSearch(context: context, delegate: FtsSearchDelegate());
30+
},
31+
icon: const Icon(Icons.search),
32+
),
33+
statusIcon,
34+
// Make some space for the "Debug" banner, so that the status
35+
// icon isn't hidden
36+
if (kDebugMode) _makeIcon('Debug mode', Icons.developer_mode),
37+
],
38+
);
39+
},
6040
);
6141
}
6242
}

0 commit comments

Comments
 (0)