You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Uses `ReadableStream.tee()` to split response streams
144
-
- One stream for progress/chunk tracking, another for response body parsing
145
-
- Enables progress callbacks without consuming the response
146
-
- Creates a new Response object with the teed stream to maintain compatibility
142
+
3.**Response Cloning for Progress Tracking**
143
+
- Uses `response.clone()` to create a separate copy for progress/chunk tracking
144
+
- Original response is used for body parsing, clone is consumed for progress
145
+
- Enables progress callbacks without affecting the response consumption
147
146
148
147
4.**Timeout Mechanism**
149
148
- Uses `AbortSignal.timeout()` for timeout implementation (modern browser API)
@@ -364,7 +363,7 @@ Network failures and HTTP errors are wrapped in `Result` type via `happy-rusty`.
364
363
365
364
1.**Progress tracking requires Content-Length header**: If the server doesn't send this header, progress tracking will fail (onProgress receives an Err). The `Headers.get()` method is case-insensitive per the HTTP spec.
366
365
367
-
2.**Stream tee() limitation**: Progress/chunk callbacks add overhead due to stream splitting. Each chunk is read twice - once for tracking, once for parsing.
366
+
2.**Response cloning overhead**: Progress/chunk callbacks clone the response, which may have memory implications for very large responses.
368
367
369
368
3.**Import extensions**: Source code uses `.ts` extensions in imports which is non-standard but enabled by TypeScript bundler mode.
0 commit comments