Skip to content
Discussions/App Development/What is the difference between a transaction and completion message in a Daml trigger?Forum ↗

What is the difference between a transaction and completion message in a Daml trigger?

App Development5 posts163 views1 likesLast activity Aug 2022
AS
asarpeshkarOP
Aug 2022

A trigger’s updateState function has the signature Message -> TriggerUpdateA s (). A Message can be a Transaction, Completion, or Heartbeat, which indicates that they’re mutually exclusive. However, Completion is the only message that includes a completion status.

For successful transactions, when would one receive a Completion rather than a Transaction?

And for a failed transaction, would one always receive a Completion rather than a Transaction?

CO
cocreature
Aug 2022

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.

AS
asarpeshkar
Aug 2022

So for successful commands, updateState will be invoked twice?

CO
cocreature
Aug 2022

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.

AS
asarpeshkar
Aug 2022

Thanks, it’s helpful to know that the semantics mirror the ledger API.

← Back to Discussions