Skip to content

Bring back the commit parameter in aggregate event handlers #4

@rkaw92

Description

@rkaw92

Previously, a commit parameter was normally included in on* aggregate methods. This has proven to be incorrect, as the commit was only being passed during aggregate rehydration, not in nominal operation (because of the difference between _applyEvent vs. _applyCommit).
For a commit parameter to make sense in both cases, a dummy Commit would have to be created on the first run (non-rehydration) and populated with the predicted sequenceSlot.
An additional note needs to be taken that the metadata may still vary between runs - the party responsible for loading the aggregate may pass extra arguments to Commit, thus enriching it.

An alternative may be to abandon the commit parameter in aggregate event handlers altogether and remove it from all test cases / examples. The aggregates would then be forced to use their internal counters (via getNextSequenceNumber() ?) at time of event application.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions