Commit 6815c8f
committed
fix(js-sdk): stop waiting for stream close after command end event
On receiving the "end" event in iterateEvents(), call
handleDisconnect() to abort the transport controller, then return
from the generator to stop blocking on the stream.
In handleEvents(), ignore iteration errors when a result has already
been captured since the error is from the expected abort. After the
generator exits, fire a .next() call on the events stream to trigger
connectrpc's deadline timer cleanup — on platforms where abort
propagates to the body reader (Deno) this clears the timer
immediately; on Node.js (nodejs/undici#1940) it settles when the
server closes the stream.1 parent dc77742 commit 6815c8f
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| |||
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
237 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
238 | 251 | | |
239 | 252 | | |
240 | 253 | | |
0 commit comments