updateAsync

fun updateAsync(message: String? = null, updater: suspend (root: JsonObject, presence: DocPresence) -> Unit): Deferred<OperationResult>

Executes the given updater to update this document.

Throws YorkieException.Code.ErrRefused while a Client.resyncAsync call on this document is between its discard and its re-anchor -- a new failure mode reachable once any caller opts into resync, including when updater itself was already running before the resync started and only resumes afterward.

Parameters

skipHistory

Skips recording this change on the undo/redo history stacks when true. The change still mutates the document, emits events, and syncs normally; only the undo entry and redo-stack clearing are skipped, mirroring how remote changes bypass local history. Defaults to false, which preserves existing history behavior.


fun updateAsync(message: String? = null, skipHistory: Boolean, updater: suspend (root: JsonObject, presence: DocPresence) -> Unit): Deferred<OperationResult>

Executes the given updater to update this document.

A skipHistory write is treated exactly like a remote client's write for history purposes: pending undo/redo entries are index-reconciled against it, but an entry whose target element it overwrites or removes is not retargeted and undoes/redoes as a no-op or replay, as with remote changes.

Parameters

skipHistory

Skips recording this change on the undo/redo history stacks when true. The change still mutates the document, emits events, and syncs normally; only the undo entry and redo-stack clearing are skipped, mirroring how remote changes bypass local history.