Repository navigation
fix(fetch): preserve response size errors across runtime wrappers - #11179
jasonsaayman merged 6 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Greptile SummaryThe fetch adapter correctly isolates foreign AxiosErrors carried as the cause of a fetch-shaped network failure. The exercised request returned a new A custom Confidence Score: 4/5The fetch error-handling change behaves correctly, but the public Response override contract remains incompatible with streamed response tracking. One actionable non-security request-failure issue remains: a declared custom Response constructor can reject the streamed body Axios passes during download-progress handling. Files Needing Attention: index.d.ts, index.d.cts
|
|
The only failing check I can see is Greptile Review, with no actionable code failure in the public status. Happy to adjust if a reviewer has a concrete finding. |
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
… and fix Response types
2bcabed to
f9f2949
Compare
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
…-length-error-unmasking # Conflicts: # PRE_RELEASE_CHANGELOG.md
Summary
When a fetch response exceeds
maxContentLength, some runtimes replace the stream error with a generic fetch failure. Preserve the current request's originalERR_BAD_RESPONSE, config, and request even when the runtime drops the cause.env.Responseconstructor signatures and document their conditional runtime stream requirements in both public declarations. Custom implementations must accept trackedReadableStream<Uint8Array>bodies for enabledmaxContentLengthlimits, download progress, or cancellation/timeout tracking of stream/response results.ArrayBufferViewinputs, invalid bodies, and Node-only imports in both ESM and CommonJS declaration tests.Validation
Rebased onto
v1.xated95c083, preserving its cache-mode fix and isolated fetch test servers.npm run lint,npm run build, andnpm pack --ignore-scriptspassed.Compatibility
Patch fix preserving existing size limits, default adapter selection, constructor signatures, and genuine network-error handling. No migration is required. The legacy constructor body type does not express conditional stream inputs; its documentation now states the existing runtime requirement explicitly without narrowing accepted constructors or introducing DOM-only type dependencies.