-
Notifications
You must be signed in to change notification settings - Fork 14k
fix(core): MessageBus.request() silently hangs 60s when publish() fails #22588
Copy link
Copy link
Open
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalityeffort/small1 day or less: trivial logic, UI adjustments, docs1 day or less: trivial logic, UI adjustments, docskind/bugpriority/p2Important but can be addressed in a future release.Important but can be addressed in a future release.status/bot-triagedtype/bug🔒 maintainer only⛔ Do not contribute. Internal roadmap item.⛔ Do not contribute. Internal roadmap item.
Metadata
Metadata
Assignees
Labels
area/coreIssues related to User Interface, OS Support, Core FunctionalityIssues related to User Interface, OS Support, Core Functionalityeffort/small1 day or less: trivial logic, UI adjustments, docs1 day or less: trivial logic, UI adjustments, docskind/bugpriority/p2Important but can be addressed in a future release.Important but can be addressed in a future release.status/bot-triagedtype/bug🔒 maintainer only⛔ Do not contribute. Internal roadmap item.⛔ Do not contribute. Internal roadmap item.
Type
Fields
Give feedbackNo fields configured for Bug.
Projects
StatusShow more project fields
No status
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.