Skip to content

Fix handling stream priority overrides#586

Merged
simolus3 merged 2 commits intomainfrom
sync-subscription-priority-fix
Mar 30, 2026
Merged

Fix handling stream priority overrides#586
simolus3 merged 2 commits intomainfrom
sync-subscription-priority-fix

Conversation

@simolus3
Copy link
Copy Markdown
Contributor

Previously, we would apply the priority of a bucket as seen by a client in BucketChecksumState.translateResolvedBucket. That method looks up subscriptions for a bucket and then applies priorities based on that subscription. Unfortunately, clients are the only ones seeing that. In the service, we'd still use the original ResolvedBucket to sort buckets by priority and emit partial_checkpoint_complete lines.

This mismatch causes clients to expect (or not to expect) buckets in partially completed checkpoints, which leads to checksum errors on the client. I think the cleanest fix is to not apply priorities in translateResolvedBucket. Instead, queriers already know for which Sync Stream subscription they're querying buckets. Passing the patched priority to the queriers and letting them emit the correct priority on ResolvedBucket resolves this issue.

As far as I can tell, this has been broken since the initial alpha release of Sync Streams.

Closes #584.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 24, 2026

🦋 Changeset detected

Latest commit: 84bbf5d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@powersync/service-sync-rules Minor
@powersync/service-core Patch
@powersync/service-image Patch
@powersync/service-jpgwire Patch
@powersync/service-core-tests Patch
@powersync/lib-services-framework Patch
@powersync/service-module-mongodb-storage Patch
@powersync/service-module-mongodb Patch
@powersync/service-module-mssql Patch
@powersync/service-module-mysql Patch
@powersync/service-module-postgres-storage Patch
@powersync/service-module-postgres Patch
@powersync/service-module-core Patch
test-client Patch
@powersync/lib-service-postgres Patch
@powersync/service-rsocket-router Patch
@powersync/lib-service-mongodb Patch
@powersync/service-schema Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@simolus3 simolus3 requested a review from rkistner March 24, 2026 15:24
@simolus3 simolus3 merged commit 2b72c2a into main Mar 30, 2026
104 of 106 checks passed
@simolus3 simolus3 deleted the sync-subscription-priority-fix branch March 30, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client-side priority override causes unrecoverable checksum mismatch loop

3 participants