Skip to content

fix(client): stop listen() rejections escaping as unhandledRejection during an in-flight send - #2642

Merged
felixweinberger merged 2 commits into
mainfrom
fix/listen-opening-unhandled-rejection
Sep 28, 2026
Merged

felixweinberger merged 2 commits into
mainfrom
fix/listen-opening-unhandled-rejection

fix(client): stop listen() rejections escaping as unhandledRejection …

1edbafd
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 11, 2026 in 5m 10s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing packages/client/src/client/client.ts:2109-2136 McpSubscription.close() still hangs forever on a parked send (sibling path of the fixed hang)

Annotations

Check notice on line 2136 in packages/client/src/client/client.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

McpSubscription.close() still hangs forever on a parked send (sibling path of the fixed hang)

Pre-existing issue (unchanged lines, same state machine): `McpSubscription.close()` retains the same hang class this PR fixes for `listen()` — it serially `await wireTeardown()`, which ends in an un-abortable `transport.send` of `notifications/cancelled`, so under the same parked-send condition the new tests model (stdio write parked on 'drain'), `await sub.close()` suspends forever. Consider mirroring the fire-and-forget pattern the ack-timeout and caller-abort paths already use, or bounding th