Bug Description
MessageBus.request() contains a floating promise that causes two failure modes when publish()
rejects:
- The rejection is routed to
this.emit('error', error) on the EventEmitter. If no error
listener is registered at call time, Node.js throws an uncaught exception and crashes the
process.
- Even with an error listener, the
Promise returned by request() silently hangs for the full
60-second timeout instead of failing fast — the caller gets no immediate signal that the publish
failed.
Root Cause
In packages/core/src/confirmation-bus/message-bus.ts, inside the new Promise() constructor
callback, this.publish() is not awaited and has no .catch() chain:
// eslint-disable-next-line @typescript-eslint/no-floating-promises,
@typescript-eslint/no-unsafe-type-assertion
this.publish({ ...request, correlationId } as TRequest);
Fix
Chain .catch(reject) on the publish call so any publish failure immediately cancels the timeout and rejects the caller. This affects any code path that calls messageBus.request() — including the planned STEP_THROUGH_REQUEST/RESPONSE flow in step-through mode, where a malformed message would deadlock the scheduler for 60 seconds.
Bug Description
MessageBus.request()contains a floating promise that causes two failure modes whenpublish()rejects:
this.emit('error', error)on the EventEmitter. If noerrorlistener is registered at call time, Node.js throws an uncaught exception and crashes the
process.
Promisereturned byrequest()silently hangs for the full60-second timeout instead of failing fast — the caller gets no immediate signal that the publish
failed.
Root Cause
In
packages/core/src/confirmation-bus/message-bus.ts, inside thenew Promise()constructorcallback,
this.publish()is not awaited and has no.catch()chain:Fix
Chain .catch(reject) on the publish call so any publish failure immediately cancels the timeout and rejects the caller. This affects any code path that calls messageBus.request() — including the planned STEP_THROUGH_REQUEST/RESPONSE flow in step-through mode, where a malformed message would deadlock the scheduler for 60 seconds.