Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a command fire more than one event? #139

Open
tommiii opened this issue Jan 24, 2019 · 3 comments
Open

Can a command fire more than one event? #139

tommiii opened this issue Jan 24, 2019 · 3 comments

Comments

@tommiii
Copy link

tommiii commented Jan 24, 2019

Can a command fire more than one event? Is that supported by the library? I've noticed a missmatch in the revision field when I fire 2 events from the same command, like if one revision is actually skipped.

e.g.:
command 'openTask' could fire two events 'taskOpened' and 'urgentTaskOpened' if the task is urgent.
If the aggregate 'task' has revision 'n' in this scenario, the 2 events will have revision 'n+2' into the eventstore

@nanov
Copy link
Contributor

nanov commented Jan 24, 2019

Of course it can, it is a pretty common situation, they are all committed in a single commit.
The revision, however, is incremented with each single event.

ie. a revision is not skipped, the first event would have revision of previousRevision+1, the next one of previsousRevision+2, and the new state of the aggregate would have the same revision as the last event in the commit. This is the expected behaviour.

@tommiii
Copy link
Author

tommiii commented Jan 24, 2019

We're not having the expected behaviour. Is there something we could missing?

@nanov
Copy link
Contributor

nanov commented Jan 24, 2019

I Really couldn't tell without at least seeing a snippet.

As this behaviour is well tested ( on both eventstore and domain side ), I would guess that there is some kind of misunderstanding of the expected behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants