Skip to content

Commit 63b856a

Browse files
committed
Improve log messages.
1 parent 120c953 commit 63b856a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/powersync/lib/src/bucket_storage.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ class BucketStorage {
345345
SET last_applied_op = last_op
346346
WHERE last_applied_op != last_op""");
347347

348-
isolateLogger.fine('Updated local database');
348+
isolateLogger.fine('Applied checkpoint ${checkpoint.lastOpId}');
349349
return true;
350350
});
351351
}
@@ -407,7 +407,11 @@ class BucketStorage {
407407
final invalidBuckets = db.select(
408408
"SELECT name, target_op, last_op, last_applied_op FROM ps_buckets WHERE target_op > last_op AND (name = '\$local' OR pending_delete = 0)");
409409
if (invalidBuckets.isNotEmpty) {
410-
isolateLogger.fine('Cannot update local database: $invalidBuckets');
410+
if (invalidBuckets.first['name'] == '\$local') {
411+
isolateLogger.fine('Waiting for local changes to be acknowledged');
412+
} else {
413+
isolateLogger.fine('Waiting for more data: $invalidBuckets');
414+
}
411415
return false;
412416
}
413417
// This is specifically relevant for when data is added to crud before another batch is completed.
@@ -506,7 +510,7 @@ class BucketStorage {
506510
// Note: Count is informational only.
507511
if (local.checksum != checksum.checksum) {
508512
isolateLogger.warning(
509-
'Checksum mismatch for ${checksum.bucket}: local ${local.checksum} != remote ${checksum.checksum}');
513+
'Checksum mismatch for ${checksum.bucket}: local ${local.checksum} != remote ${checksum.checksum}. Likely due to sync rule changes.');
510514
failedChecksums.add(checksum.bucket);
511515
}
512516
}

0 commit comments

Comments
 (0)