Commit 8e0b918
committed
fix(client): reset retry/upscoping state on close() and prevent stale reconnects after restart
- close() now resets _serverRetryMs and _lastUpscopingHeader so a restarted
transport does not inherit the previous session's server-provided retry
delay or upscoping-loop guard state.
- _scheduleReconnection and _handleSseStream capture the abort signal at
schedule time instead of re-reading this._abortController. After
close() + start() the field points at the new session's controller, so
the previous read allowed a stale reconnect to fire into the restarted
transport.
- Added tests for both cases.1 parent 043e452 commit 8e0b918
2 files changed
Lines changed: 53 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
344 | 349 | | |
345 | 350 | | |
346 | | - | |
| 351 | + | |
347 | 352 | | |
| 353 | + | |
348 | 354 | | |
349 | 355 | | |
350 | 356 | | |
| |||
369 | 375 | | |
370 | 376 | | |
371 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
372 | 381 | | |
373 | 382 | | |
374 | 383 | | |
| |||
436 | 445 | | |
437 | 446 | | |
438 | 447 | | |
439 | | - | |
| 448 | + | |
440 | 449 | | |
441 | 450 | | |
442 | 451 | | |
| |||
455 | 464 | | |
456 | 465 | | |
457 | 466 | | |
458 | | - | |
| 467 | + | |
459 | 468 | | |
460 | 469 | | |
461 | 470 | | |
| |||
512 | 521 | | |
513 | 522 | | |
514 | 523 | | |
| 524 | + | |
| 525 | + | |
515 | 526 | | |
516 | 527 | | |
517 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1998 | 1998 | | |
1999 | 1999 | | |
2000 | 2000 | | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
2001 | 2026 | | |
2002 | 2027 | | |
2003 | 2028 | | |
| |||
2059 | 2084 | | |
2060 | 2085 | | |
2061 | 2086 | | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
2062 | 2101 | | |
2063 | 2102 | | |
0 commit comments