Commit 254616d
committed
fix(client): per-request abort in StreamableHTTP is a clean shutdown — no onerror, no reconnect
McpSubscription.close() aborts the listen POST via requestSignal, but
_handleSseStream only knew about the transport-level abort: every close()
fired a misleading 'SSE stream disconnected' onerror, and (when the server
had stamped SSE event ids for resumability) scheduled a GET+Last-Event-ID
reconnect that resurrected the subscription the caller just tore down.
Thread the per-request requestSignal into _handleSseStream via
StartSSEOptions; when EITHER the transport signal or the per-request
signal is aborted, skip onerror and skip reconnect (mirrors the existing
transport-level reconnect guard).1 parent 85eadc3 commit 254616d
2 files changed
Lines changed: 77 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| |||
391 | 400 | | |
392 | 401 | | |
393 | 402 | | |
394 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
395 | 410 | | |
396 | 411 | | |
397 | 412 | | |
| |||
460 | 475 | | |
461 | 476 | | |
462 | 477 | | |
463 | | - | |
| 478 | + | |
464 | 479 | | |
465 | 480 | | |
466 | 481 | | |
| |||
471 | 486 | | |
472 | 487 | | |
473 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
474 | 494 | | |
475 | 495 | | |
476 | 496 | | |
| |||
479 | 499 | | |
480 | 500 | | |
481 | 501 | | |
482 | | - | |
| 502 | + | |
483 | 503 | | |
484 | 504 | | |
485 | 505 | | |
| |||
699 | 719 | | |
700 | 720 | | |
701 | 721 | | |
702 | | - | |
| 722 | + | |
703 | 723 | | |
704 | 724 | | |
705 | 725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1102 | 1102 | | |
1103 | 1103 | | |
1104 | 1104 | | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1105 | 1158 | | |
1106 | 1159 | | |
1107 | 1160 | | |
| |||
0 commit comments