Table of Contents

Method WaitForSync

Namespace
PowerSync.Common.Client.Sync
Assembly
PowerSync.Common.dll

WaitForSync(CancellationToken)

Waits until this checkpoint has been synced locally.

This method fails on sync errors: If a download or upload error occurs before this checkpoint request has synced, that error is rethrown here. This makes it easier to observe sync errors when relying on checkpoints. Once sync has recovered, it is valid to call this method again to await the checkpoint.

public Task WaitForSync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task

Exceptions

CheckpointRequestException
OperationCanceledException

Thrown if the cancellation token is canceled. Importantly, this is not thrown if the checkpoint has already finished syncing, as there is no work to be canceled.