Skip to content

Apply the write checkpoint after draining the CRUD queue - #36

Merged
simolus3 merged 1 commit into
powersync-ja:mainfrom
GuionAI:fix/apply-write-checkpoint-after-draining-crud
Sep 16, 2026
Merged

simolus3 merged 1 commit into
powersync-ja:mainfrom
GuionAI:fix/apply-write-checkpoint-after-draining-crud

Conversation

@birdmanmandbir

Copy link
Copy Markdown
Contributor

What changed

  • Treat DONE from the post-delete CRUD query as an empty queue.
  • Apply the provided write checkpoint only in that case.
  • Add an integration regression test that completes the final CRUD transaction with checkpoint 42.

Root cause

SELECT 1 FROM ps_crud LIMIT 1 returns ROW when a CRUD item remains and DONE when the queue is empty. Checking OK meant the supplied checkpoint could never be selected.

Validation

  • cargo fmt --all -- --check
  • cargo test -p powersync applies_checkpoint_after_draining_crud_queue
  • cargo test -p powersync --all-features
  • cargo clippy -p powersync --all-targets -- -D warnings

Fixes #34

@simolus3
simolus3 merged commit b131a93 into powersync-ja:main Sep 16, 2026
2 checks passed
@birdmanmandbir
birdmanmandbir deleted the fix/apply-write-checkpoint-after-draining-crud branch September 16, 2026 08: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.

Apply the write checkpoint after draining the CRUD queue

2 participants