Commit dd20e04
fix(client): always create cache buster on 409 and fix parked frame leak in #start
Two fixes:
1. Both 409 handlers (#requestShape and #fetchSnapshotWithRetry) now
unconditionally create a cache buster instead of only doing so
conditionally when the handle is missing or recycled. This eliminates
the same-handle 409 infinite loop (where identical retry URLs would
hit CDN cache forever) and removes two conditional branches, making
the behavior safer and easier to verify exhaustively.
2. Changed `await this.#start(); return` to `return this.#start()` in
the onError retry path. The old pattern parked the outer #start frame
on the call stack for the entire lifetime of the replacement stream,
accumulating one frame per error recovery. The new pattern resolves
the outer frame immediately.
Also adds model-based test commands for 409-no-handle and 409-same-handle
scenarios, plus a targeted regression test verifying consecutive same-handle
409s produce unique retry URLs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent a6c237f commit dd20e04
File tree
2 files changed
+97
-11
lines changed- packages/typescript-client
- src
- test
2 files changed
+97
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
775 | | - | |
776 | | - | |
| 775 | + | |
777 | 776 | | |
778 | 777 | | |
779 | 778 | | |
| |||
911 | 910 | | |
912 | 911 | | |
913 | 912 | | |
914 | | - | |
915 | 913 | | |
916 | 914 | | |
917 | 915 | | |
918 | 916 | | |
919 | 917 | | |
920 | 918 | | |
921 | | - | |
922 | 919 | | |
| 920 | + | |
923 | 921 | | |
924 | 922 | | |
925 | 923 | | |
| |||
1935 | 1933 | | |
1936 | 1934 | | |
1937 | 1935 | | |
1938 | | - | |
1939 | 1936 | | |
1940 | 1937 | | |
1941 | | - | |
1942 | | - | |
1943 | | - | |
1944 | | - | |
1945 | | - | |
1946 | 1938 | | |
1947 | 1939 | | |
1948 | 1940 | | |
1949 | 1941 | | |
1950 | 1942 | | |
1951 | 1943 | | |
1952 | | - | |
1953 | 1944 | | |
| 1945 | + | |
1954 | 1946 | | |
1955 | 1947 | | |
1956 | 1948 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
105 | 121 | | |
106 | 122 | | |
107 | 123 | | |
| |||
484 | 500 | | |
485 | 501 | | |
486 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
487 | 579 | | |
488 | 580 | | |
489 | 581 | | |
| |||
498 | 590 | | |
499 | 591 | | |
500 | 592 | | |
| 593 | + | |
| 594 | + | |
501 | 595 | | |
502 | 596 | | |
503 | 597 | | |
| |||
0 commit comments