Sync / Editing server data

Handling conflicts, compaction, and cell marks

  • Absorbing history: Calling absorb records a server-originated operation stating that the table holds every edit up to the recovery cursor. Replicas drop those edits and the journal compacts old entries so new devices receive a small snapshot. Guard AbsorbedEdits in authorize so only the server can append it.
  • Held edits: If the slice drops an absorbed edit while a page still holds an older cached row, reconcile keeps that edit's overlay held and returns its row key in held so the page can refresh the row.
  • Conflicts: The later journal commit wins, regardless of when an offline edit was typed. reconcile returns a replaced entry whenever another replica's commit overwrites this replica's edit—even across two tabs signed in as the same user, or when a read catches an edit that was already absorbed.
  • Refusals: Rejected operations return to the sender with their error; cellsOf identifies the affected cells so the UI can mark them while the rest of the outbox proceeds.
  • Cell status marks: Cells can display pending, committed, refused, replaced, and peer-presence states using GridMarkStyle and GridLegend.
  • Unchanged drafts: Leaving an open cell editor unchanged emits no edit, avoiding accidental overwrites of another device's concurrent change.