-
Notifications
You must be signed in to change notification settings - Fork 5
Description
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.