Commit 72aacb4
authored
fix(impit-client): pause fromWeb stream to prevent early consumption (#3347)
Attaching a 'data' listener on Readable.fromWeb(response.body) switches
the stream into flowing mode. This can start consuming the response body
before Crawlee attaches its pipeline consumer, so initial chunks are
lost and the downstream sees a truncated stream. That also aswers why
only retries worked.
Fix: call responseStream.pause() right after registering the 'data'
handler. The stream stays paused until the pipeline/pipe attaches and
resumes it, preventing early consumption while still allowing progress
tracking.
Closes [WCC issue
#555](apify/store-website-content-crawler#555)1 parent a978ab3 commit 72aacb4
1 file changed
Lines changed: 16 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
224 | 229 | | |
225 | | - | |
| 230 | + | |
226 | 231 | | |
227 | 232 | | |
228 | 233 | | |
| |||
0 commit comments