Skip to content

Commit b142b80

Browse files
fix(client): close transport when connect-signal aborts during auto-open ack wait; drop old-layout listen examples (live in #2325); e2e CLAUDE.md doc nit
1 parent ebf896d commit b142b80

6 files changed

Lines changed: 10 additions & 147 deletions

File tree

examples/client/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Most clients expect a server to be running. Start one from [`../server/README.md
3636
| Client credentials (M2M) | Machine-to-machine OAuth client credentials example. | [`src/simpleClientCredentials.ts`](src/simpleClientCredentials.ts) |
3737
| URL elicitation client | Drives URL-mode elicitation flows (sensitive input in a browser). | [`src/elicitationUrlExample.ts`](src/elicitationUrlExample.ts) |
3838
| Multi-round-trip client (2026-07-28) | Calls a write-once tool twice: default auto-fulfilment, then manual mode. | [`src/multiRoundTripClient.ts`](src/multiRoundTripClient.ts) |
39-
| Subscriptions/listen client (2026-07-28) | `listChanged` auto-open then manual `client.listen()`; closes after a few changes. | [`src/subscriptionsListenClient.ts`](src/subscriptionsListenClient.ts) |
4039

4140
## URL elicitation example (server + client)
4241

examples/client/src/subscriptionsListenClient.ts

Lines changed: 0 additions & 80 deletions
This file was deleted.

examples/server/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ pnpm tsx src/simpleStreamableHttp.ts
3939
| Hono Streamable HTTP server | Streamable HTTP server built with Hono instead of Express. | [`src/honoWebStandardStreamableHttp.ts`](src/honoWebStandardStreamableHttp.ts) |
4040
| SSE polling demo server | Legacy SSE server intended for polling demos. | [`src/ssePollingExample.ts`](src/ssePollingExample.ts) |
4141
| Multi-round-trip server (2026-07-28) | Write-once tool that returns `inputRequired(...)` (form + URL elicitation, requestState echo) via `createMcpHandler`. | [`src/multiRoundTrip.ts`](src/multiRoundTrip.ts) |
42-
| Subscriptions/listen server (2026-07-28) | Publishes `tools/list_changed` to open `subscriptions/listen` streams via `handler.notify.toolsChanged()`. | [`src/subscriptionsListen.ts`](src/subscriptionsListen.ts) |
4342

4443
## OAuth demo flags (Streamable HTTP server)
4544

examples/server/src/subscriptionsListen.ts

Lines changed: 0 additions & 61 deletions
This file was deleted.

packages/client/src/client/client.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -974,9 +974,15 @@ export class Client extends Protocol<ClientContext> {
974974
});
975975
} catch (error) {
976976
// Connect-signal abort during the ack wait propagates as a
977-
// connect() rejection (caller asked to abort connect); a
978-
// server-side refusal stays a soft onerror.
979-
if (options?.signal?.aborted) throw error;
977+
// connect() rejection (caller asked to abort connect). The
978+
// transport is already started, so close it before
979+
// rethrowing — a connect() rejection MUST NOT leave a
980+
// half-open connection. A server-side refusal stays a
981+
// soft onerror (connect succeeds, no listen stream).
982+
if (options?.signal?.aborted) {
983+
void this.close();
984+
throw error;
985+
}
980986
this.onerror?.(error instanceof Error ? error : new Error(String(error)));
981987
} finally {
982988
options?.signal?.removeEventListener('abort', onConnectAbort);

test/e2e/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ entryExclusions: [{ arm: 'entryModern', reason: 'method-not-in-modern-registry'
7373
```
7474

7575
Omitting `arm` excludes both arms. The reasons (`EntryExclusionReason` in types.ts) are the acceptance checklist for re-admitting cells when the corresponding entry feature lands; a coverage gate rejects annotations that would never have an effect. Requirement families that the
76-
per-request entry structurally cannot serve at all (server→client requests, sessions/resumability, standalone GET streams, subscriptions) are already expressed through their `transports` restrictions and need no annotation.
76+
per-request entry structurally cannot serve at all (server→client requests, sessions/resumability, standalone GET streams) are already expressed through their `transports` restrictions and need no annotation.
7777

7878
Arm-specific helpers: `wire()`'s fourth argument also accepts `entry` (createMcpHandler hosting overrides — e.g. a `responseMode` or a different `legacy` posture), the returned `Wired.httpLog` records every HTTP exchange (request body, status, content-type, a readable response
7979
clone) for raw wire assertions, factories may accept the optional per-request context (`EntryServerFactory`), and `modernEnvelopeMeta()` builds the envelope for bodies that POST raw 2026-era requests through `wired.fetch`. Compositions that the entry no longer expresses through

0 commit comments

Comments
 (0)