Skip to content

ConflictPolicy

ConflictPolicy = "last-write-wins" | "reject-if-stale"

Defined in: packages/contracts/src/config.ts:25

The per-writable-table Conflict policy (ADR-0015): what happens to a stale write — one whose Base server version is behind the row’s current Server version at apply (an external write interleaved). It is a required declaration on every writable table; there is no silent default (registry validation rejects an undeclared writable table — the third hard-require). v1:

  • last-write-wins — apply the stale write anyway. A required, named declaration: the toolkit never silently clobbers under an unspecified default, so choosing this is an explicit acceptance of the stale-overwrite semantics.
  • reject-if-stale — do not apply; surface the conflict so the user’s edit is kept (the optimistic Overlay stays, marked conflicted) and resolved as a new write.

field-merge (apply only the changed fields over the current row) and custom-resolver (a client re-resolution protocol) are reserved values for future policies — declared here so the policy surface names its full intended range.