Skip to content

Commit c7ab28b

Browse files
committed
Update changelog entry
1 parent db8eff4 commit c7ab28b

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

.changeset/rich-shrimps-push.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
'@powersync/service-image': minor
44
---
55

6-
Add the `versioned_bucket_ids` quirk which, when opting in to the fix, generates bucket ids in a way that is more efficient for clients to adopt around sync rule redeploys.
6+
Add the `versioned_bucket_ids` option in the `config:` block for sync rules. When enabled, generated bucket ids include the version of sync rules. This allows clients to sync more efficiently after updating sync rules.

packages/service-core/test/src/sync/BucketChecksumState.test.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ import {
1717
ParameterLookup,
1818
SqlSyncRules,
1919
RequestJwtPayload,
20-
BucketSource,
21-
BucketSourceType,
22-
BucketParameterQuerier
20+
BucketSource
2321
} from '@powersync/service-sync-rules';
2422
import { describe, expect, test, beforeEach } from 'vitest';
2523

@@ -661,9 +659,9 @@ config:
661659

662660
beforeEach(() => {
663661
storage = new MockBucketChecksumStateStorage();
664-
storage.updateTestChecksum({ bucket: 'stream|0["default"]', checksum: 1, count: 1 });
665-
storage.updateTestChecksum({ bucket: 'stream|0["a"]', checksum: 1, count: 1 });
666-
storage.updateTestChecksum({ bucket: 'stream|0["b"]', checksum: 1, count: 1 });
662+
storage.updateTestChecksum({ bucket: '1#stream|0["default"]', checksum: 1, count: 1 });
663+
storage.updateTestChecksum({ bucket: '1#stream|0["a"]', checksum: 1, count: 1 });
664+
storage.updateTestChecksum({ bucket: '1#stream|0["b"]', checksum: 1, count: 1 });
667665
});
668666

669667
test('includes defaults', async () => {
@@ -677,7 +675,7 @@ config:
677675
expect(line?.checkpointLine).toEqual({
678676
checkpoint: {
679677
buckets: [
680-
{ bucket: 'stream|0["default"]', checksum: 1, count: 1, priority: 3, subscriptions: [{ default: 0 }] }
678+
{ bucket: '1#stream|0["default"]', checksum: 1, count: 1, priority: 3, subscriptions: [{ default: 0 }] }
681679
],
682680
last_op_id: '1',
683681
write_checkpoint: undefined,
@@ -726,9 +724,9 @@ config:
726724
expect(line?.checkpointLine).toEqual({
727725
checkpoint: {
728726
buckets: [
729-
{ bucket: 'stream|0["a"]', checksum: 1, count: 1, priority: 3, subscriptions: [{ sub: 0 }] },
730-
{ bucket: 'stream|0["b"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 1 }] },
731-
{ bucket: 'stream|0["default"]', checksum: 1, count: 1, priority: 3, subscriptions: [{ default: 0 }] }
727+
{ bucket: '1#stream|0["a"]', checksum: 1, count: 1, priority: 3, subscriptions: [{ sub: 0 }] },
728+
{ bucket: '1#stream|0["b"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 1 }] },
729+
{ bucket: '1#stream|0["default"]', checksum: 1, count: 1, priority: 3, subscriptions: [{ default: 0 }] }
732730
],
733731
last_op_id: '1',
734732
write_checkpoint: undefined,
@@ -758,8 +756,8 @@ config:
758756
expect(line?.checkpointLine).toEqual({
759757
checkpoint: {
760758
buckets: [
761-
{ bucket: 'stream|0["a"]', checksum: 1, count: 1, priority: 3, subscriptions: [{ sub: 0 }] },
762-
{ bucket: 'stream|0["b"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 0 }, { sub: 1 }] }
759+
{ bucket: '1#stream|0["a"]', checksum: 1, count: 1, priority: 3, subscriptions: [{ sub: 0 }] },
760+
{ bucket: '1#stream|0["b"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 0 }, { sub: 1 }] }
763761
],
764762
last_op_id: '1',
765763
write_checkpoint: undefined,
@@ -786,9 +784,9 @@ config:
786784
expect(line?.checkpointLine).toEqual({
787785
checkpoint: {
788786
buckets: [
789-
{ bucket: 'stream|0["a"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 0 }] },
787+
{ bucket: '1#stream|0["a"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 0 }] },
790788
{
791-
bucket: 'stream|0["default"]',
789+
bucket: '1#stream|0["default"]',
792790
checksum: 1,
793791
count: 1,
794792
priority: 1,
@@ -823,10 +821,10 @@ config:
823821
expect(line?.checkpointLine).toEqual({
824822
checkpoint: {
825823
buckets: [
826-
{ bucket: 'stream|0["a"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 0 }] },
827-
{ bucket: 'stream|0["b"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 0 }] },
824+
{ bucket: '1#stream|0["a"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 0 }] },
825+
{ bucket: '1#stream|0["b"]', checksum: 1, count: 1, priority: 1, subscriptions: [{ sub: 0 }] },
828826
{
829-
bucket: 'stream|0["default"]',
827+
bucket: '1#stream|0["default"]',
830828
checksum: 1,
831829
count: 1,
832830
priority: 3,

0 commit comments

Comments
 (0)