wip feat: Request checkpoint#153
Draft
stevensJourney wants to merge 9 commits into
Draft
Conversation
…fore updating local targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This is the Swift SDK implementation of the Request Checkpoint proposal: https://github.com/orgs/powersync-ja/discussions/324
Related to:
This adds a new
requestCheckpointmethod which returns aCheckpointRequest. TheCheckpointRequestinstance exposes awaitForSyncmethod which resolves once the request has been synced and applied to the clientThe SDK is updated to cater for the Rust core and PowerSync service changes. The
SyncStatushas been updated to expose thelastAppliedCheckpointRequestId- used to resolve checkpoint requests.Demo
The
PowerSyncExamplehas been updated to include aPull to refreshaction which will show a loading spinner until a checkpoint request has been resolved.In order to showcase the functionality a bit better, a new Admin page has been added to the demo which conveys the SyncStatus. In the demo below, we go offline, create 50k todos which will be synced then connect and await a checkpoint request. We can see the download progress reach 100%, but the data is only available after the checkpoint has been applied locally - the checkpoint request correctly keeps the operation in a loading state until the data is actually available.
request-checkpoint.mp4
Todos
AI disclosure: This work was assisted by Codex GPT 5.5. I manually guided and reviewed all the changes.