@@ -38,11 +38,14 @@ The following commands are supported:
383810 . ` next_checkpoint_request_id ` : No payload. During an active sync iteration after checkpoint
3939 request state exists locally, allocates and returns the next checkpoint request id as an
4040 integer result.
41- 11 . ` local_target_op ` : Payload is ` null ` , an integer, or an integer string. Probes, updates or
41+ 11 . ` current_checkpoint_request_id ` : No payload. Returns the current checkpoint request sequence
42+ value as an integer result, or SQL ` NULL ` if absent. This command does not allocate a new id and
43+ can run outside a sync iteration.
44+ 12 . ` local_target_op ` : Payload is ` null ` , an integer, or an integer string. Probes, updates or
4245 clears the local target op and returns the previously-observed value as an integer result, or
4346 SQL ` NULL ` if there was no target. This command can run outside of a sync iteration and does not
4447 affect it.
45- 12 . ` seed_checkpoint_request_id ` : Payload is a positive integer or integer string. After receiving
48+ 13 . ` seed_checkpoint_request_id ` : Payload is a positive integer or integer string. After receiving
4649 ` EstablishSyncStream ` , SDKs should reconcile the local hint with service-side
4750 checkpoint-request state, then seed core with the accepted positive id.
4851
@@ -62,13 +65,17 @@ what SDKs need to do.
6265 id to the service, then store the accepted id with ` powersync_control('local_target_op', id) ` .
6366- ` local_target_op ` is the apply gate for local writes. ` next_checkpoint_request_id ` only allocates
6467 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.
6571- Resolve explicit checkpoint waiters from ` DidCompleteSync.applied_checkpoint_request_id ` . SDKs
6672 that drive waiters from status snapshots can also watch
6773 ` UpdateSyncStatus.status.internal_last_applied_checkpoint_request_id ` . Treat that status field as
6874 runtime-only SDK state, not persisted checkpoint state or app-visible progress.
6975
7076Most ` powersync_control ` commands return a JSON-encoded array of instructions for the client.
71- ` next_checkpoint_request_id ` and ` local_target_op ` return scalar values directly.
77+ ` next_checkpoint_request_id ` , ` current_checkpoint_request_id ` and ` local_target_op ` return values
78+ directly.
7279
7380``` typescript
7481type Instruction = { LogLine: LogLine }
0 commit comments