`timeout` option doesn't timeout body parsing
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 195
- PR merge metrics
- No merged PRs in 30d
Description
Environment
ofetch: 1.5.1
Node.js: v22.21.1
Reproduction
https://github.com/dword-design/demo-ofetch-response-body-timeout
node index.js
Describe the bug
Looks like the timeout option only covers the request phase, but when a response is incomplete, the body parsing hangs.
Expected
When the response is incomplete, the request is aborted with a timeout error.
Actual
The request doesn't return.
Additional context
It works with { signal: AbortSignal.timeout(<timeout>) }. Probably because this is passed to the underlying fetch call.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction and run node index.js to observe the incomplete response body. Trace how the timeout option and AbortSignal.timeout(<timeout>) reach the underlying fetch call; done means an incomplete response is aborted and returns a timeout error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100