Skip to content

JavaScript: Dismiss an overwrite

dismissOverwrite(id) flags one journal entry as acknowledged. It stops appearing in List overwrites unless that call asks for dismissed entries too.

Examples#

Basic#

// src/todo-list.ts
import type { TOverwriteRecord } from 'kizunasync'
import { kizunasync } from './kizunasync'

export async function acknowledgeOverwrite(entry: TOverwriteRecord): Promise<void> {
  await kizunasync.dismissOverwrite(entry.id)
}

Acknowledge everything shown#

// src/todo-list.ts
import { kizunasync } from './kizunasync'

for (const entry of await kizunasync.overwrites()) {
  await kizunasync.dismissOverwrite(entry.id)
}

Parameters#

NameTypeRequiredDescription
idnumberYesThe id of a record from List overwrites.

Returns#

Promise<void> that settles once the flag is written. The entry stays in the journal with dismissed set to true, so a later call that passes includeDismissed returns it regardless.

Errors#

This method throws nothing. An id that matches no entry updates no rows and settles normally, so dismissing twice is safe.

Notes#

Dismissing is an acknowledgement, not a repair. The column already holds the peer's value: loserValue on the journal row is the only place your device's replaced value is still readable, and nothing here restores it. Restore an overwritten assign shows the write that would.

React: useOverwrites returns this method beside the journal rows, so a component lists and acknowledges through one hook.

The flag is client-local, like the journal itself. It is not pushed, another device does not learn about it, and Reset deletes the entry along with everything else.

Found a problem? Edit this page on GitHub