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

defaultCommandHandler bug, adding "undefined" to array of evtsToDispatch #143

Open
rakamoviz opened this issue Mar 19, 2019 · 1 comment

Comments

@rakamoviz
Copy link

https://github.com/adrai/node-cqrs-domain/blob/4e70105b11a444b02c12f2850c61242b4998361c/lib/defaultCommandHandler.js#L896

There should be a check like this: rakamoviz@99fbc06 in order to avoid "undefined" getting pushed to evtsToDispatch

That happens when stream.eventsToDispatch is "undefined"; and stream.eventsToDispatch is "undefined" when you have eventPublisher attached to the eventstore: https://github.com/adrai/node-eventstore#async-interface

@rakamoviz rakamoviz changed the title defaultCommandHandler bug, addin "undefined" to array of evtsToDispatch defaultCommandHandler bug, adding "undefined" to array of evtsToDispatch Mar 19, 2019
@adrai
Copy link
Contributor

adrai commented Mar 19, 2019

In theory yes. The question is, why it’s undefined?
Can you provide a PR that checks for an array?

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