Skip to content

MutationSummary

Defined in: packages/contracts/src/runtime.ts:73

A registry-wide mutation-journal summary for warm-store observability: the per-status counts across EVERY writable table’s journal, folded from one aggregate query/subscription over the pgxsinkit_all_mutations view — so a consumer renders a global sync indicator with ONE subscription instead of one live query per writable journal. Cheap enough to mount permanently.

unsettledCount and settledCount PARTITION the total — the user-facing “is any local edit still owed?” split, NOT the automatic state machine’s terminal/non-terminal split:

  • unsettledCount = pending + sending + failed + conflicted + quarantined — every write still needing work or user action. conflicted and quarantined are journal-TERMINAL in the state machine (no auto-transition — see MUTATION_TRANSITIONS) yet BOTH count as unsettled: their optimistic Overlay is KEPT, later writes for the entity stay blocked, destroy() refuses them without force, and local-store reconciliation counts them owed. The user must act (discardConflict / discardQuarantined, then re-author) — so from the consumer’s data-safety standpoint they are NOT done. This is exactly the restore case, where pgxsinkit deliberately quarantines recovered writes for the user to resolve, so a global “unsynced changes” indicator MUST include them.
  • settledCount = acked + rejected — the writes that are truly done from the user’s standpoint (acked awaits only its synced echo to be reconciled away; rejected’s Overlay was auto-discarded, nothing owed).

The field is settledCount (not terminalCount): “terminal” is the state-machine word, and quarantine is legitimately terminal there while being unsettled here — the old name invited exactly that confusion.

ackedCount: number

Defined in: packages/contracts/src/runtime.ts:76


conflictedCount: number

Defined in: packages/contracts/src/runtime.ts:79


failedCount: number

Defined in: packages/contracts/src/runtime.ts:77


pendingCount: number

Defined in: packages/contracts/src/runtime.ts:74


quarantinedCount: number

Defined in: packages/contracts/src/runtime.ts:80


rejectedCount: number

Defined in: packages/contracts/src/runtime.ts:78


sendingCount: number

Defined in: packages/contracts/src/runtime.ts:75


settledCount: number

Defined in: packages/contracts/src/runtime.ts:87

acked + rejected — settled writes; the complement of unsettledCount.


unsettledCount: number

Defined in: packages/contracts/src/runtime.ts:85

pending + sending + failed + conflicted + quarantined — every write still needing work or user action (see the interface JSDoc; quarantined + conflicted are owed local edits, not settled).