Skip to content

Reintroduce waitForFirstSync #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 29, 2024
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
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
# This action is not compatible with tags such as `powersync-v1.1.1`
# marvinpinto/action-automatic-releases struggles to generate changelogs
# Be sure to manually tag the commit to trigger this action
- 'v*'
- "powersync-v[0-9]+.[0-9]+.[0-9]+"

jobs:
build:
Expand All @@ -22,8 +22,8 @@ jobs:
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
flutter-version: "3.x"
channel: "stable"

- name: Install Melos
run: flutter pub global activate melos
Expand All @@ -32,10 +32,8 @@ jobs:
run: melos prepare

- name: Create Draft Release
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: true # TODO update when out of alpha
draft: true
files: |
assets/powersync_db.worker.js
run: |
tag="${{ github.ref_name }}"
body="Release $tag"
gh release create --draft "$tag" --title "$tag" --notes "$body" --generate-notes --prerelease
gh release upload "${{ github.ref_name }}" assets/powersync_db.worker.js
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.

## 2024-07-29

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.6.1`](#powersync---v161)
- [`powersync_attachments_helper` - `v0.6.1`](#powersync_attachments_helper---v061)

---

#### `powersync` - `v1.6.1`

- **FIX**: Reintroduce waitForFirstSync.

#### `powersync_attachments_helper` - `v0.6.1`

- Update a dependency to the latest release.


## 2024-07-25

### Changes
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.6.0
powersync: ^1.6.1
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
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.6.0
powersync: ^1.6.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.6.0
powersync: ^1.6.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.6.0
powersync: ^1.6.1
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
4 changes: 2 additions & 2 deletions demos/supabase-todolist/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync_attachments_helper: ^0.6.0
powersync: ^1.6.0
powersync_attachments_helper: ^0.6.1
powersync: ^1.6.1
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
5 changes: 5 additions & 0 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ packages:
ide:
intellij: false

command:
version:
packageFilters:
noPrivate: true

scripts:
prepare: melos bootstrap && dart ./scripts/compile_webworker.dart && dart ./scripts/init_sqlite_wasm.dart && dart ./scripts/init_powersync_core_binary.dart

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.6.1

- **FIX**: Reintroduce waitForFirstSync.

## 1.6.0

- Web support is now included in the standard release but remains in alpha. Web support may have some limitations or bugs.
Expand Down
12 changes: 12 additions & 0 deletions packages/powersync/lib/src/database/powersync_db_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ mixin PowerSyncDatabaseMixin implements SqliteConnection {
}
}

/// Returns a [Future] which will resolve once the first full sync has completed.
Future<void> waitForFirstSync() async {
if (currentStatus.hasSynced ?? false) {
return;
}
await for (final result in statusStream) {
if (result.hasSynced ?? false) {
break;
}
}
}

@protected
void setStatus(SyncStatus status) {
if (status != currentStatus) {
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.6.0
version: 1.6.1
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
4 changes: 4 additions & 0 deletions packages/powersync_attachments_helper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.1

- Update a dependency to the latest release.

## 0.6.0

- Update a dependency to the latest release.
Expand Down
4 changes: 2 additions & 2 deletions packages/powersync_attachments_helper/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: powersync_attachments_helper
description: A helper library for handling attachments when using PowerSync.
version: 0.6.0
version: 0.6.1
repository: https://github.com/powersync-ja/powersync.dart
homepage: https://www.powersync.com/
environment:
Expand All @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.6.0
powersync: ^1.6.1
logging: ^1.2.0
sqlite_async: ^0.8.1
path_provider: ^2.0.13
Expand Down
Loading