nestjs / cqrs

A lightweight CQRS module for Nest framework (node.js) :balloon:
https://nestjs.com
MIT License
848 stars 150 forks source link

Multiple modules with Sagas with same name raise errors #632

Closed SkyaTura closed 3 years ago

SkyaTura commented 3 years ago

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

If a project has two modules, when both contain a Saga with the same name, nestjs won't start.

Expected behavior

It should work properly.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Solving a bug.

Environment


Nest version: 7.6.15


For Tooling issues:
- Node version: 14.15.4  
- Platform:  Mac

Others:

SkyaTura commented 3 years ago

https://github.com/nestjs/cqrs/blob/8e24dd7acb0d7ea95d2993cd193f2189af06be1f/src/event-bus.ts#L76

I found that in this line, the instance variable may not being correct when two modules have the same name.

kamilmysliwiec commented 3 years ago

This should be fixed in v8