Closed gpanainte closed 2 years ago
@MaciejSikorski can you look into that?
@gpanainte is it an event without any handler?
@gpanainte is it an event without any handler?
hello @Sikora00,
yes we have events without any handler
Hello there,
I currently have this issue, however I do have a handler for this event.
export class CalculationGenericEvent implements AuditMessage {
constructor(
public readonly auditObject: AuditObject,
) {}
}
Then later in the code:
@EventsHandler([
// ... all the things the audit handler is listening on
// CALCULATIONS
CalculationGenericEvent,
])
export class AuditMessageHandler implements IEventHandler<AuditMessage> {
I'm in 8.0.2. Did you publish the fix? Thanks.
this has not yet been published, but it was a fix for a case when an event has no event handler. In your case, it's probably a mistake to provide events as an array @sylvainar. You can list them just with a comma.
Is there an existing issue for this?
Current behavior
I get the following error after upgrading to 8.0.1
Cannot read properties of undefined (reading 'id') => EventBus.defaultGetEventId [as getEventId] (/app/node_modules/@nestjs/cqrs/dist/helpers/default-get-event-id.js:7:72) => /app/node_modules/@nestjs/cqrs/dist/event-bus.js:81:75 => /app/node_modules/rxjs/dist/cjs/internal/operators/filter.js:9:120 => OperatorSubscriber._this._next (/app/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:33:21) => OperatorSubscriber.Subscriber.next (/app/node_modules/rxjs/dist/cjs/internal/Subscriber.js:51:18) => /app/node_modules/rxjs/dist/cjs/internal/Subject.js:66:34 => Object.errorContext (/app/node_modules/rxjs/dist/cjs/internal/util/errorContext.js:22:9) => Subject.next (/app/node_modules/rxjs/dist/cjs/internal/Subject.js:58:24) => DefaultPubSub.publish (/app/node_modules/@nestjs/cqrs/dist/helpers/default-pubsub.js:9:23) => EventBus.publish (/app/node_modules/@nestjs/cqrs/dist/event-bus.js:43:32)
The change comes from the following commit https://github.com/nestjs/cqrs/commit/c593fea78129e7309f6f62f69739a54a9b8f577e
Minimum reproduction code
i'm working on a private repository
Steps to reproduce
No response
Expected behavior
If it is a breaking change the release notes should be updated with the migration steps
Package version
8.0.1
NestJS version
8.0.6
Node.js version
2022 v17.2.0
In which operating systems have you tested?
Other
No response