Skip to content

Checkpoint Requests - #549

Open
stevensJourney wants to merge 13 commits into
mainfrom
checkpoint-requests
Open

Checkpoint Requests#549
stevensJourney wants to merge 13 commits into
mainfrom
checkpoint-requests

Conversation

@stevensJourney

@stevensJourney stevensJourney commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This adds docs for the newly introduces Checkpoints Requests function. Resolves #543

This feature is currently only supported in the Swift SDK. This should be ported to other SDKs in the near future.

For context. See these links:

TODO:

  • Release Service version
  • Release and document Swift SDK version

AI usage: I initially hand-wrote a first draft, then piped that in as context for Codex 5.6 Sol to make these changes.

@mintlify

mintlify Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
powersync 🟢 Ready View Preview Aug 3, 2026, 10:28 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.


Before creating a checkpoint request:

1. Use a PowerSync Swift SDK release that supports the alpha checkpoint request API.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should mention the specific min. version here so developers don't have to spend time looking it up

Comment thread client-sdks/advanced/checkpoint-requests.mdx Outdated
@benitav
benitav marked this pull request as ready for review August 4, 2026 11:16
Comment thread client-sdks/advanced/checkpoint-requests.mdx Outdated
Comment thread architecture/consistency.mdx Outdated

The client only updates its local state when it has all the data matching a checkpoint, and then it updates the state to exactly match that of the checkpoint. There is no intermediate state while downloading large sets of changes such as large server-side transactions. Different tables and [buckets](/architecture/powersync-service#bucket-system) are all included in the same consistent checkpoint, to ensure that the state is consistent over all data in the client.

Alpha [Checkpoint Requests](/client-sdks/advanced/checkpoint-requests) let you wait until the local database has applied a new point-in-time checkpoint after the initial sync.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This sentence reads oddly without an article: "Alpha Checkpoint Requests let you...". Consider "The alpha Checkpoint Requests API lets you..." to match the phrasing used in the note added to custom-write-checkpoints.mdx ("The alpha Checkpoint Requests API uses the term...").

Comment on lines +92 to +95
You can create an explicit checkpoint request while local writes are waiting to upload. PowerSync does not apply the requested checkpoint while those writes are pending. After the upload queue is empty, the PowerSync Client SDK creates another checkpoint request as its upload target. If the explicit request was created first, this upload target has a newer request ID, supersedes the earlier request, and captures a source position after the upload has completed.

`waitForSync()` considers the explicit request complete when the same or a newer checkpoint request has been applied locally. If the explicit request is created after the upload target instead, it captures an even later source position. You can therefore write locally and wait for the uploaded result to return through sync:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This paragraph lays out two orderings (explicit request created before vs. after the automatic upload-target request), and the example right after opens with "You can therefore...", reading as if it follows from the second case only. Given the example calls requestCheckpoint() immediately after execute(), it looks like it actually demonstrates the first case (explicit request created before the upload target). Worth confirming which case the example maps to, or rephrasing to "In either case, you can write locally and wait..." so it isn't read as tied to just the scenario immediately above it.

Comment on lines +36 to +37
1. Use PowerSync Swift SDK v1.16.0 or greater.
2. Run PowerSync Service version 1.24.0 or later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"v1.16.0 or greater" and "version 1.24.0 or later" phrase the same kind of version constraint two different ways back to back. Consider making these consistent, e.g. "version 1.16.0 or later" / "version 1.24.0 or later".

Comment thread architecture/consistency.mdx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants