Skip to content

Commit de5b7dd

Browse files
[Fix] Offline has synced (#124)
* fix offline has synced
1 parent cde73d9 commit de5b7dd

File tree

11 files changed

+62
-18
lines changed

11 files changed

+62
-18
lines changed

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
## 2024-07-16
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` - `v1.5.5`](#powersync---v155)
19+
- [`powersync_attachments_helper` - `v0.5.1+1`](#powersync_attachments_helper---v0511)
20+
21+
Packages with dependency updates only:
22+
23+
> 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.
24+
25+
- `powersync_attachments_helper` - `v0.5.1+1`
26+
27+
---
28+
29+
#### `powersync` - `v1.5.5`
30+
31+
- Fix issue where `hasSynced` is cleared when offline.
32+

demos/django-todolist/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ environment:
1010
dependencies:
1111
flutter:
1212
sdk: flutter
13-
powersync: ^1.5.0
13+
powersync: ^1.5.5
1414
path_provider: ^2.1.1
1515
path: ^1.8.3
1616
logging: ^1.2.0

demos/supabase-anonymous-auth/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313

14-
powersync: ^1.5.0
14+
powersync: ^1.5.5
1515
path_provider: ^2.1.1
1616
supabase_flutter: ^2.0.2
1717
path: ^1.8.3

demos/supabase-edge-function-auth/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313

14-
powersync: ^1.5.0
14+
powersync: ^1.5.5
1515
path_provider: ^2.1.1
1616
supabase_flutter: ^2.0.2
1717
path: ^1.8.3

demos/supabase-simple-chat/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies:
3737

3838
supabase_flutter: ^1.10.25
3939
timeago: ^3.6.0
40-
powersync: ^1.5.0
40+
powersync: ^1.5.5
4141
path_provider: ^2.1.1
4242
path: ^1.8.3
4343
logging: ^1.2.0

demos/supabase-todolist/macos/Podfile.lock

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@ PODS:
1212
- shared_preferences_foundation (0.0.1):
1313
- Flutter
1414
- FlutterMacOS
15-
- sqlite3 (3.46.0):
16-
- sqlite3/common (= 3.46.0)
17-
- sqlite3/common (3.46.0)
18-
- sqlite3/fts5 (3.46.0):
15+
- "sqlite3 (3.46.0+1)":
16+
- "sqlite3/common (= 3.46.0+1)"
17+
- "sqlite3/common (3.46.0+1)"
18+
- "sqlite3/dbstatvtab (3.46.0+1)":
1919
- sqlite3/common
20-
- sqlite3/perf-threadsafe (3.46.0):
20+
- "sqlite3/fts5 (3.46.0+1)":
2121
- sqlite3/common
22-
- sqlite3/rtree (3.46.0):
22+
- "sqlite3/perf-threadsafe (3.46.0+1)":
23+
- sqlite3/common
24+
- "sqlite3/rtree (3.46.0+1)":
2325
- sqlite3/common
2426
- sqlite3_flutter_libs (0.0.1):
2527
- FlutterMacOS
26-
- sqlite3 (~> 3.46.0)
28+
- "sqlite3 (~> 3.46.0+1)"
29+
- sqlite3/dbstatvtab
2730
- sqlite3/fts5
2831
- sqlite3/perf-threadsafe
2932
- sqlite3/rtree
@@ -67,8 +70,8 @@ SPEC CHECKSUMS:
6770
powersync-sqlite-core: 4c38c8f470f6dca61346789fd5436a6826d1e3dd
6871
powersync_flutter_libs: 1eb1c6790a72afe08e68d4cc489d71ab61da32ee
6972
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
70-
sqlite3: 154b084339ede06960a5b3c8160066adc9176b7d
71-
sqlite3_flutter_libs: 1be4459672f8168ded2d8667599b8e3ca5e72b83
73+
sqlite3: 292c3e1bfe89f64e51ea7fc7dab9182a017c8630
74+
sqlite3_flutter_libs: 5ca46c1a04eddfbeeb5b16566164aa7ad1616e7b
7275
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
7376

7477
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367

demos/supabase-todolist/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ environment:
1010
dependencies:
1111
flutter:
1212
sdk: flutter
13-
powersync_attachments_helper: ^0.5.0
14-
powersync: ^1.5.0
13+
powersync_attachments_helper: ^0.5.1
14+
powersync: ^1.5.5
1515
path_provider: ^2.1.1
1616
supabase_flutter: ^2.0.1
1717
path: ^1.8.3

packages/powersync/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.5.5
2+
3+
- Fix issue where `hasSynced` is cleared when offline.
4+
15
## 1.5.4
26

37
- Fix watch query parameter `triggerOnTables` to prepend powersync view names.

packages/powersync/lib/src/powersync_database.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,12 @@ class PowerSyncDatabase with SqliteQueries implements SqliteConnection {
348348
void _setStatus(SyncStatus status) {
349349
if (status != currentStatus) {
350350
currentStatus = status.copyWith(
351-
hasSynced: status.hasSynced ?? status.lastSyncedAt != null);
351+
// Note that currently the streaming sync implementation will never set hasSynced.
352+
// lastSyncedAt implies that syncing has completed at some point (hasSynced = true).
353+
// The previous values of hasSynced should be preserved here.
354+
hasSynced: status.lastSyncedAt != null
355+
? true
356+
: status.hasSynced ?? currentStatus.hasSynced);
352357
_statusStreamController.add(currentStatus);
353358
}
354359
}

packages/powersync/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: powersync
2-
version: 1.5.4
2+
version: 1.5.5
33
homepage: https://powersync.com
44
repository: https://github.com/powersync-ja/powersync.dart
55
description: PowerSync Flutter SDK - keep PostgreSQL databases in sync with on-device SQLite databases.

packages/powersync_attachments_helper/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
flutter:
1111
sdk: flutter
1212

13-
powersync: ^1.5.0
13+
powersync: ^1.5.5
1414
logging: ^1.2.0
1515
sqlite_async: ^0.8.1
1616
path_provider: ^2.0.13

0 commit comments

Comments
 (0)