Commit c646a1a
committed
fix(client): McpSubscription.close() is transport-agnostic — always abort + send notifications/cancelled
The close path branched on detectProbeTransportKind(), which detects child-
process transports, not 'honors requestSignal'. On InMemoryTransport, SSE,
or any custom transport, close() resolved without ever telling the server,
leaving the subscription open server-side.
close() now unconditionally aborts the listen request's requestSignal AND
sends notifications/cancelled for the listen id. The abort closes the SSE
stream where the transport honors it; the cancelled notification reaches the
stdio listen router and any spec-compliant server. Idempotent over HTTP,
correct on every other transport. detectProbeTransportKind is no longer in
the close path.1 parent ac9446e commit c646a1a
2 files changed
Lines changed: 24 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
1235 | 1237 | | |
1236 | 1238 | | |
1237 | 1239 | | |
| |||
1263 | 1265 | | |
1264 | 1266 | | |
1265 | 1267 | | |
1266 | | - | |
1267 | 1268 | | |
1268 | 1269 | | |
1269 | 1270 | | |
| |||
1310 | 1311 | | |
1311 | 1312 | | |
1312 | 1313 | | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
1316 | 1322 | | |
| 1323 | + | |
1317 | 1324 | | |
1318 | | - | |
| 1325 | + | |
1319 | 1326 | | |
1320 | 1327 | | |
1321 | 1328 | | |
1322 | | - | |
1323 | | - | |
1324 | 1329 | | |
1325 | 1330 | | |
1326 | 1331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
106 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
107 | 112 | | |
108 | | - | |
109 | | - | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
0 commit comments