Skip to content

Commit 7ed6945

Browse files
committed
Only verify relevant buckets
1 parent c99c043 commit 7ed6945

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/powersync_core/lib/src/bucket_storage.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class BucketStorage {
176176
final rs =
177177
await select("SELECT powersync_validate_checkpoint(?) as result", [
178178
jsonEncode({
179-
...checkpoint.toJson(),
179+
...checkpoint.toJson(priority: priority),
180180
if (priority != null) 'priority': priority,
181181
})
182182
]);

packages/powersync_core/lib/src/sync_types.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,12 @@ final class Checkpoint extends StreamingSyncLine {
5252
.map((b) => BucketChecksum.fromJson(b))
5353
.toList();
5454

55-
Map<String, dynamic> toJson() {
55+
Map<String, dynamic> toJson({int? priority}) {
5656
return {
5757
'last_op_id': lastOpId,
5858
'write_checkpoint': writeCheckpoint,
5959
'buckets': checksums
60+
.where((c) => priority == null || c.priority <= priority)
6061
.map((c) => {'bucket': c.bucket, 'checksum': c.checksum})
6162
.toList(growable: false)
6263
};

0 commit comments

Comments
 (0)