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

When trying to upgrade nestjs/cqrs version to latest (8.0.5), eventPublishers no longer seem to be working #23

Open
alfQontrol opened this issue Jul 13, 2022 · 2 comments

Comments

@alfQontrol
Copy link

Hello,

We are trying to find an event sourcing solution that would fit our business requirements. Currently, we are considering using the NestJS implementation of CQRS on its latest version.
To integrate your library to our project, we tried first the corresponding example project, which would work just perfectly (Hero Killed, then other eventHandler & sagas were triggered)
Unfortunately, just by upgrading the version of nestjs/cqrs version in the package.json, things would break silently; initial event seems to be published, but no trigger of any related EventHandler.
This issue should be easily reproduced by checking out the above mentioned project, and by upgrading the cqrs library version.

Any idea of how to solve this issue ?

Thanks a lot !

@esalu
Copy link

esalu commented Nov 12, 2022

try with this solution autoCommit = true

const hero = this.publisher.mergeObjectContext(
  await this.repository.findOneById(id),
);
hero.autoCommit = true;
hero.create(data, { user });
//hero.commit();

@ashutoshadaptivecode
Copy link

Hey @esalu, The above alternative seems to be working but again the autoCommit will be not suitable for every scenario . is there any other way we can able to fix the hero.commit() part ?

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

3 participants