sync
namespace syncFunctions
deleteData(): Promise<boolean>
Deletes the stored document and turns syncing off on this device, so it is not uploaded again. Other devices keep what they have installed.
Returns
Whether the document was deleted. Failures are recorded as lastError.
isApplying(): boolean
Returns
Whether a sync is applying remote changes right now, so the changes it makes can be told apart.
isEnabled(): boolean
Returns
Whether this device syncs automatically.
now(strategy?: SyncStrategy): Promise<boolean>
Syncs now: reads the stored document, merges, applies remote changes here and saves the result. A call while a sync runs queues one more run after it, in this device's mode.
Returns
Whether the sync succeeded. Failures are recorded as lastError in SYNC_BUCKET.
resolveFirstSync(strategy: SyncStrategy): Promise<boolean>
Settles how this device and an existing cloud setup combine on the first sync after signing in, then turns automatic syncing on.
Returns
Whether the sync succeeded.
setEnabled(enabled: boolean): Promise<boolean>
Turns automatic syncing on or off. Turning it on syncs right away, or first asks how to combine this device with a cloud setup it has never synced with.
Returns
Whether turning it on could read the cloud; always true when turning it off.
Types
Which way automatic syncs move changes on this device.
How one sync reconciles the two sides: merge keeps changes from both, pull makes this device
match the cloud, and push makes the cloud match this device.
Variables
SYNC_BUCKET: "unbound::sync"
The Bucket Sync keeps its mode and last agreed document in. Never synced.