Commit 06aad3a
authored
fix(standard-server): throw error for waiting operation if event iterator cancelled (#974)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- Bug Fixes
- Cancelling an ongoing iteration now reliably stops the stream and
surfaces a clear cancellation error instead of appearing to complete
normally.
- Distinguishes explicit cancellation from natural completion to prevent
delivering a final value after cancellation and ensures the stream
closes promptly and instrumentation remains consistent.
- Tests
- Added tests verifying that cancelling while awaiting the next item
rejects with the cancellation error, closes the stream, and updates
instrumentation as expected.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 80c9415 commit 06aad3a
File tree
2 files changed
+43
-1
lines changed- packages/standard-server-fetch/src
2 files changed
+43
-1
lines changedLines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
183 | 207 | | |
184 | 208 | | |
185 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
29 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
30 | 47 | | |
31 | 48 | | |
32 | 49 | | |
| |||
82 | 99 | | |
83 | 100 | | |
84 | 101 | | |
| 102 | + | |
85 | 103 | | |
86 | 104 | | |
87 | 105 | | |
| |||
0 commit comments