Commit 52fb100
committed
fix: don't reconnect POST stream when response was already received
Per SEP-1699, the client should only reconnect when the server
disconnects BEFORE sending a response (for long-running operations).
The previous implementation would reconnect after ANY stream completion
when a priming event was received, even when the response was already
delivered.
This fix tracks whether a response was received and skips reconnection
if so. This prevents:
1. Unnecessary network round-trips
2. Race conditions with rapid stream cycling (which caused crashes in
consumers like the inspector)
Adds test case to verify the correct behavior.1 parent b4c6090 commit 52fb100
2 files changed
+70
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
869 | 924 | | |
870 | 925 | | |
871 | 926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
| |||
346 | 349 | | |
347 | 350 | | |
348 | 351 | | |
349 | | - | |
350 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
351 | 358 | | |
352 | 359 | | |
353 | 360 | | |
| |||
359 | 366 | | |
360 | 367 | | |
361 | 368 | | |
| 369 | + | |
362 | 370 | | |
363 | | - | |
| 371 | + | |
| 372 | + | |
364 | 373 | | |
365 | 374 | | |
366 | 375 | | |
| |||
376 | 385 | | |
377 | 386 | | |
378 | 387 | | |
| 388 | + | |
379 | 389 | | |
380 | | - | |
| 390 | + | |
| 391 | + | |
381 | 392 | | |
382 | 393 | | |
383 | 394 | | |
| |||
0 commit comments