File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
packages/powersync_core/lib/src/sync Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,21 @@ class BucketStorage {
181181 final rs = await tx.execute ('SELECT last_insert_rowid() as result' );
182182 final result = rs[0 ]['result' ];
183183 if (result == 1 ) {
184+ if (forPartialPriority == null ) {
185+ // Reset progress counters. We only do this for a complete sync, as we
186+ // want a download progress to always cover a complete checkpoint
187+ // instead of resetting for partial completions.
188+ await tx.execute ('''
189+ UPDATE ps_buckets SET count_since_last = 0, count_at_last = ?1->name
190+ WHERE ?1->name IS NOT NULL
191+ ''' , [
192+ json.encode ({
193+ for (final bucket in checkpoint.checksums)
194+ if (bucket.count case final count? ) bucket.bucket: count,
195+ }),
196+ ]);
197+ }
198+
184199 return true ;
185200 } else {
186201 // can_update_local(db) == false
You can’t perform that action at this time.
0 commit comments