Repository navigation
Commit 54f904d
fix(core): key the connect retry leg off attempt, bound nested recoveries
Second-pass review findings on #1809:
- The satisfied-recovery short-circuit keyed off live connection status, so an
onclose landing between the nested connect() and the retry leg fell through
to the rejected handshake promise and reported the stale 401 as the reason
the session died. withDirectAuthRecovery now passes `attempt` to its
operation, so connect() identifies the retry leg structurally and reports the
teardown when the recovered session is already gone.
- Bound nested silent recoveries. The `attempt >= 1` guard is per-call and a
satisfied outcome recovers via a nested connect() with a fresh counter, so a
server that keeps rejecting freshly refreshed tokens recursed without bound.
Counted across the nesting boundary, capped at 3.
- Strengthen the regression test (server info populated by the nested connect,
no duplicate statusChange) and add the two missing cases: a failed reconnect
still rejects, and the recursion bound terminates.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016S7h83UKNQ7kvSiFDNksCt1 parent fc0395e commit 54f904d
2 files changed
Lines changed: 112 additions & 9 deletions
File tree
- clients/web/src/test/core/mcp
- core/mcp
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
120 | 130 | | |
121 | 131 | | |
122 | 132 | | |
| |||
125 | 135 | | |
126 | 136 | | |
127 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
128 | 190 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
538 | 554 | | |
539 | 555 | | |
540 | 556 | | |
| |||
1809 | 1825 | | |
1810 | 1826 | | |
1811 | 1827 | | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
1816 | 1832 | | |
1817 | 1833 | | |
1818 | 1834 | | |
| |||
1821 | 1837 | | |
1822 | 1838 | | |
1823 | 1839 | | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
1824 | 1845 | | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
1825 | 1851 | | |
1826 | 1852 | | |
1827 | 1853 | | |
| |||
5336 | 5362 | | |
5337 | 5363 | | |
5338 | 5364 | | |
5339 | | - | |
| 5365 | + | |
5340 | 5366 | | |
5341 | 5367 | | |
5342 | 5368 | | |
5343 | 5369 | | |
5344 | | - | |
| 5370 | + | |
| 5371 | + | |
| 5372 | + | |
| 5373 | + | |
5345 | 5374 | | |
5346 | 5375 | | |
5347 | 5376 | | |
5348 | 5377 | | |
5349 | 5378 | | |
5350 | 5379 | | |
5351 | 5380 | | |
| 5381 | + | |
| 5382 | + | |
| 5383 | + | |
| 5384 | + | |
| 5385 | + | |
| 5386 | + | |
| 5387 | + | |
5352 | 5388 | | |
5353 | 5389 | | |
5354 | 5390 | | |
| |||
5367 | 5403 | | |
5368 | 5404 | | |
5369 | 5405 | | |
5370 | | - | |
| 5406 | + | |
| 5407 | + | |
| 5408 | + | |
| 5409 | + | |
| 5410 | + | |
| 5411 | + | |
5371 | 5412 | | |
5372 | 5413 | | |
5373 | 5414 | | |
| |||
5390 | 5431 | | |
5391 | 5432 | | |
5392 | 5433 | | |
5393 | | - | |
| 5434 | + | |
5394 | 5435 | | |
5395 | 5436 | | |
5396 | 5437 | | |
5397 | | - | |
| 5438 | + | |
5398 | 5439 | | |
5399 | 5440 | | |
5400 | 5441 | | |
| |||
0 commit comments