booster icon indicating copy to clipboard operation
booster copied to clipboard

fix: do not crash if no reducer is found

Open thomas-advantitge opened this issue 3 years ago • 2 comments

Should fix:

[Booster]|BoosterEventDispatcher#dispatch:  Unhandled error while dispatching event:  PromisesError: TypeError: Cannot read properties of undefined (reading 'class')
    at Function.allSettledAndFulfilled (node_modules/@boostercloud/framework-common-helpers/dist/promises.js:31:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Function.dispatchEntityEventsToEventHandlers (node_modules/@boostercloud/framework-core/dist/booster-event-dispatcher.js:56:13)
    at node_modules/@boostercloud/framework-core/dist/booster-event-dispatcher.js:34:13
    at Function.streamPerEntityEvents (node_modules/@boostercloud/framework-core/dist/services/raw-events-parser.js:16:13)
    at Function.dispatch (node_modules/@boostercloud/framework-core/dist/booster-event-dispatcher.js:24:13)
    at Object.storeEvents [as store] (node_modules/@advantitge/booster-framework-provider-micro/dist/library/events-adapter.js:79:5)
    at BoosterCommandDispatcher.dispatchCommand (node_modules/@boostercloud/framework-core/dist/booster-command-dispatcher.js:47:9)
    at node_modules/@boostercloud/framework-core/dist/services/graphql/graphql-generator.js:60:28
    at BoosterGraphQLDispatcher.handleQueryOrMutation (node_modules/@boostercloud/framework-core/dist/booster-graphql-dispatcher.js:130:24) {
  failedReasons: [
    TypeError: Cannot read properties of undefined (reading 'class')
        at Function.getEntityTypeName (node_modules/@boostercloud/framework-core/dist/booster-register-handler.js:47:28)
        at wrapEvent (node_modules/@boostercloud/framework-core/dist/booster-register-handler.js:15:48)
        at Array.map (<anonymous>)
        at Function.handle (node_modules/@boostercloud/framework-core/dist/booster-register-handler.js:11:64)
        at node_modules/@boostercloud/framework-core/dist/booster-event-dispatcher.js:69:67
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
  ]
}

thomas-advantitge avatar Aug 12 '22 10:08 thomas-advantitge

Fixes #1181

NickSeagull avatar Oct 03 '22 10:10 NickSeagull

Thanks for the fix! Merging as soon as integration tests pass

NickSeagull avatar Oct 03 '22 10:10 NickSeagull