File tree Expand file tree Collapse file tree 3 files changed +25
-10
lines changed
packages/powersync/lib/src/database Expand file tree Collapse file tree 3 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 99 # This action is not compatible with tags such as `powersync-v1.1.1`
1010 # marvinpinto/action-automatic-releases struggles to generate changelogs
1111 # Be sure to manually tag the commit to trigger this action
12- - ' v* '
12+ - " powersync-v[0-9]+.[0-9]+.[0-9]+ "
1313
1414jobs :
1515 build :
2222 - name : Install Flutter
2323 uses : subosito/flutter-action@v2
2424 with :
25- flutter-version : ' 3.x'
26- channel : ' stable'
25+ flutter-version : " 3.x"
26+ channel : " stable"
2727
2828 - name : Install Melos
2929 run : flutter pub global activate melos
3232 run : melos prepare
3333
3434 - name : Create Draft Release
35- uses : ' marvinpinto/action-automatic-releases@latest'
36- with :
37- repo_token : ' ${{ secrets.GITHUB_TOKEN }}'
38- prerelease : true # TODO update when out of alpha
39- draft : true
40- files : |
41- assets/powersync_db.worker.js
35+ run : |
36+ tag="${{ github.ref_name }}"
37+ body="Release $tag"
38+ gh release create --draft "$tag" --title "$tag" --notes "$body" --generate-notes --prerelease
39+ gh release upload "${{ github.ref_name }}" assets/powersync_db.worker.js
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ packages:
88ide :
99 intellij : false
1010
11+ command :
12+ version :
13+ packageFilters :
14+ noPrivate : true
15+
1116scripts :
1217 prepare : melos bootstrap && dart ./scripts/compile_webworker.dart && dart ./scripts/init_sqlite_wasm.dart && dart ./scripts/init_powersync_core_binary.dart
1318
Original file line number Diff line number Diff line change @@ -104,6 +104,18 @@ mixin PowerSyncDatabaseMixin implements SqliteConnection {
104104 }
105105 }
106106
107+ /// Returns a [Future] which will resolve once the first full sync has completed.
108+ Future <void > waitForFirstSync () async {
109+ if (currentStatus.hasSynced ?? false ) {
110+ return ;
111+ }
112+ await for (final result in statusStream) {
113+ if (result.hasSynced ?? false ) {
114+ break ;
115+ }
116+ }
117+ }
118+
107119 @protected
108120 void setStatus (SyncStatus status) {
109121 if (status != currentStatus) {
You can’t perform that action at this time.
0 commit comments