Docs Client library reference Swift
v0.2.6-alpha.3Swift: Dismiss a rejection
dismissRejection(_:) marks one journal entry acknowledged. The entry stays in the local database and can be read back, but does not appear in the default list a screen shows.
Examples#
Basic#
// TodoApp/TodoListView.swift (excerpt)
import KizunaSync
let acknowledged = try await kizunasync.dismissRejection(mutationId)Clear what the user has seen#
// TodoApp/TodoListView.swift (excerpt)
import KizunaSync
for entry in try await kizunasync.rejections() {
_ = try await kizunasync.dismissRejection(entry.mutationId)
}Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
mutationId | String | Yes | The mutationId of the entry, as List rejections 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#
| Code | Condition |
|---|---|
STORE | The journal could not be updated. |
ENGINE_UNAVAILABLE | The client has no engine because Initializing has not run. |
Notes#
Dismissing changes nothing about the write itself. The local row was already reverted when the rejection was journalled, so this is a read-state flag for the interface, not a retry: to try the change again, apply it again with Update data after fixing what the server objected to.
A later run that journals the same mutation id replaces the entry and clears the flag, so a repeated failure comes back into view rather than staying hidden. Read the dismissed entries with rejections(includeDismissed: true).
Related reference#
Found a problem? Edit this page on GitHub