Enum AppendOutcome
- Namespace
- Excalibur.EventSourcing
- Assembly
- Excalibur.EventSourcing.Abstractions.dll
What an append actually did, as a single named outcome rather than a combination of flags.
public enum AppendOutcome
Fields
AlreadyCommitted = 1The events were already durably present when this call ran, and the store recognised them as its own by identity rather than writing them a second time.
This is a success — the append the caller asked for is durable — so Success is true and a caller that only asks "did it work" is answered correctly without change.
It is nevertheless distinct from Committed, because the rows were written by an earlier call whose acknowledgement was lost, and present does not imply retrievable: those rows may have been acted on in between. A caller still holding the live payloads must not assume they are what the store would now return.
Committed = 0This call wrote the events and the store acknowledged the write.
ConcurrencyConflict = 2The append lost its version precondition to another writer. Nothing was written.
Failed = 3The append failed for its own reasons. Nothing was written.
Unknown = 4The provider cannot determine whether the complete atomic append committed.
Neither a failed acknowledgement nor an empty recovery read proves rollback. Preserve the original operation identity, payloads and expected version for reconciliation. Do not regenerate or rebase the operation merely because this outcome is not success.
Remarks
Why a discriminator and not another flag. An append has five reported outcomes and exactly one of them holds at a time. Expressing that as independent booleans leaves three quarters of the combinations unreachable but still constructible, and each new flag doubles them — a named constructor per legal combination is this enumeration written longhand, with the illegal ones left representable.
The state this exists to add is AlreadyCommitted. A store that recognises its own durably-present events after a lost acknowledgement previously had no way to say so: it reported plain success, which is true about the append and silently false about the call. A caller that must behave differently on a recognised retry — because it holds live in-memory payloads whose retrievability it cannot assume — could not distinguish the two, and no care at the call site recovers a distinction the type does not carry.