Skip to content

Commit 035b0ba

Browse files
cleanup docs
1 parent 2c55f24 commit 035b0ba

1 file changed

Lines changed: 3 additions & 22 deletions

File tree

docs/sync.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,9 @@ The following commands are supported:
5252
## Checkpoint Request Expectations
5353

5454
Checkpoint request state exists to protect local writes and to support explicit "wait until synced"
55-
requests. The detailed state model lives in `write-checkpoint-requests.md`; this section summarizes
56-
what SDKs need to do.
57-
58-
- On every connection, reconcile `EstablishSyncStream.last_checkpoint_request_id` with the service.
59-
Post at least `1` when there is no known id, then call
60-
`powersync_control('seed_checkpoint_request_id', acceptedId)`.
61-
The service returns the maximum of client and service-side state, so this hydrates a client that
62-
lost its local value and recreates service-side state when the service lost its record.
63-
- Wait for seeding to complete before creating checkpoint requests. For an upload write checkpoint,
64-
call `powersync_control('next_checkpoint_request_id', NULL)` in a transaction, post the returned
65-
id to the service, then store the accepted id with `powersync_control('target_checkpoint_request_id', id)`.
66-
- `target_checkpoint_request_id` is the apply gate for local writes. `next_checkpoint_request_id` only allocates
67-
ids; it does not update that gate.
68-
- To retry a checkpoint request without incrementing the counter, read
69-
`powersync_control('current_checkpoint_request_id', NULL)` and repost that id when the SDK's
70-
runtime last-applied checkpoint request id is absent or lower.
71-
- Resolve explicit checkpoint waiters from `DidCompleteSync.applied_checkpoint_request_id`. SDKs
72-
that drive waiters from the sync status should react to
73-
`UpdateSyncStatus.status.internal_last_applied_checkpoint_request_id` on the status update that
74-
carries it: core clears the field on later status updates without an applied request id and on
75-
reconnects, so it is an event-style signal, not a high-water mark to poll. Treat that status
76-
field as runtime-only SDK state, not persisted checkpoint state or app-visible progress.
55+
requests. The state model, the per-connection reconciliation and seeding flow, and how SDKs resolve
56+
checkpoint waiters (through `DidCompleteSync.applied_checkpoint_request_id` or the equivalent
57+
sync-status field) are documented in `write-checkpoint-requests.md`.
7758

7859
Most `powersync_control` commands return a JSON-encoded array of instructions for the client.
7960
`next_checkpoint_request_id`, `current_checkpoint_request_id` and `target_checkpoint_request_id` return values

0 commit comments

Comments
 (0)