Skip to content

Swift: Dismiss an overwrite

dismissOverwrite(_:) marks one overwrite journal entry acknowledged. The entry stays in the local database and can be read back with includeDismissed: true, but does not appear in the default list a screen shows.

Examples#

Basic#

// TodoApp/TodoListView.swift (excerpt)
import KizunaSync

let acknowledged = try await kizunasync.dismissOverwrite(entryId)

Clear what the user has seen#

// TodoApp/TodoListView.swift (excerpt)
import KizunaSync

for entry in try await kizunasync.overwrites() {
  _ = try await kizunasync.dismissOverwrite(entry.id)
}

Parameters#

NameTypeRequiredDescription
idInt64YesThe id of the entry, as List overwrites reports it.

Returns#

Bool. true when an entry carried that id, whether it was already dismissed or not; false only when no entry carries that id.

Errors#

CodeCondition
STOREThe journal could not be written.
ENGINE_UNAVAILABLEThe bridge answered with an envelope carrying no code, which is not a gradeable failure.
ENGINE_UNAVAILABLEThe client has no engine because Initializing has not run.

Notes#

Dismissing changes nothing about the column's value: the peer's write already stands, and this is a read-state flag for the interface, not a way to reassert the local value. To write the column again, apply it again with Update data.

This method reaches the kernel through the same JSON-RPC call every typed method uses underneath; it behaves like any other client method and raises the same KizunaSyncError.engine.

Found a problem? Edit this page on GitHub