Skip to content

Conversation

@simolus3
Copy link
Contributor

@simolus3 simolus3 commented Feb 24, 2025

For clients, a full sync iteration generally looks like this:

  1. They receive a checkpoint message describing the target state of each bucket.
  2. For each bucket, data lines are sent for data.
  3. Finally, a checkpoint_complete line is sent and allows clients to make the lines they've received public if it matches the target state from earlier.

After the changes to the sync service for bucket priorities and partial completions, we also send a partial_checkpoint_complete line as part of step 2 after sending all data lines in a specific priority (except for the lowest priority, which results in the traditional checkpoint_complete line).
These changes introduced a regression observable when performing a sync iteration with no changed buckets (which can happen when only write checkpoints are changed). Since there are no buckets and no priorities, there is no lowest priority for which a checkpoint_complete line would be sent. This breaks clients, which only consider the sync complete after receiving that line.

Fix this by ensuring we always send a checkpoint_complete after a finished sync operation.

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2025

🦋 Changeset detected

Latest commit: cbc4de8

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

This PR includes changesets to release 9 packages
Name Type
@powersync/service-core Patch
@powersync/service-core-tests Patch
@powersync/service-module-mongodb-storage Patch
@powersync/service-module-mongodb Patch
@powersync/service-module-mysql Patch
@powersync/service-module-postgres-storage Patch
@powersync/service-module-postgres Patch
@powersync/service-image Patch
test-client 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 marked this pull request as ready for review February 24, 2025 13:40
Copy link
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified this fixes the issue on my end. Thanks!

@simolus3 simolus3 merged commit 964a34d into main Feb 24, 2025
20 checks passed
@simolus3 simolus3 deleted the fix/fix-missing-completion-for-empty-checkpoint branch February 24, 2025 15:45
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.

3 participants