Handle a queued write's verdict

Settle each write a working copy sent that the instance didn't take as it was, without losing the person's edit, and tell which writes an answer saw.

After a drain, marfa device queue lists every write with its verdict, and --json adds the instance's answer. accepted and merged need nothing.

A conflicted write

The item holds the other writer's value, and the person's edit went into a conflicted copy, a new item tagged conflicted-copy. The write's conflicted_copy_id names it: show the person both, as Sort out a conflicted copy does.

Later edits made over that text follow it there, so one conflicted copy holds the person's latest text. Each unsent edit of the item that changes only fields kept in both copies, such as a note's body and notes, goes to the conflicted copy on version 1, its entry naming it in item_id, answered accepted. An edit queued --exact, sent --as-read an earlier version, or that changes another field too, such as the title, stays on the original item. A synced folder's store moves no edit.

The moved body's links and embeds make no edges on the original item: those edge writes leave the queue unsent.

A refused write

Read the instance's answer in marfa device queue --json, fix it in a new write, then remove the refused one with marfa device discard <id>. A write refused unsent, because the write it followed was refused, goes again once that one is fixed: marfa device release <id>, then drain.

A blocked or dead write

A blocked write waits for something outside the queue, which its reason names, and a dead one failed five times. Release or withdraw it.

Tell which writes an answer saw

Each write has a seq, its queue number: higher than that of every write queued before it in the store, never changed and never given twice, through restarts, hydrations and set-asides. An answered write also has answered_after_seq, the highest seq the store had given when it stored the answer. Write B was queued before write A's answer when B.seq is at most A.answered_after_seq.

Compare the numbers, never queued_at and answered_at: a clock set back gives a later write an earlier time. Send order can differ from seq.

marfa device forget clears the answered writes, and keeps each refused write that carried content until you discard it. The rules are in the contract's queue and verdicts chapter.

On this page