What is the difference between a transaction and completion message in a Daml trigger?
- asarpeshkarOP 1
A trigger’s
updateStatefunction has the signatureMessage -> TriggerUpdateA s (). AMessagecan be aTransaction,Completion, orHeartbeat, which indicates that they’re mutually exclusive. However,Completionis the only message that includes a completion status.For successful transactions, when would one receive a
Completionrather than aTransaction?And for a failed transaction, would one always receive a
Completionrather than aTransaction? - cocreature
For a successful commands you will receive both a transaction and a completion. For failed commands you will only received a failded completion. Triggers just mirror the transaction service and completion service.
- asarpeshkar
So for successful commands,
updateStatewill be invoked twice? - cocreature
Yes, you don’t get guarantees about the order just like you don’t get guarantees if you subscribe to the corresponding ledger API streams.
- asarpeshkar
Thanks, it’s helpful to know that the semantics mirror the ledger API.