web-std-io
web-std-io copied to clipboard
fix: 🐛 abort should be after request body has consumer
PR is related to: https://github.com/remix-run/remix/issues/3971
The original issue can reproduce by the following examples:
- https://github.com/kayac-chang/remix-abort-test/tree/main
- https://gitpod.io/start/#kayacchang-remixabortte-0ohsnxppt54
Currently, in unit test, the controller abort the request before it actually fired, the request.body is not be consume by reader yet.
After the defer, the test is failed with the following message.
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "do
ne()" is called; if returning a Promise, ensure it resolves. (/Users/kayac/Pr
ojects/web-std-io/packages/fetch/test/main.js)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
I didn't have an answer to solve it, and I'm try to list down the questions for everyone input
- I don't know which body we using currently, Is it come from node global api or web-streams-polyfill ?
- Why body stream don't cancel even we try to abort it?
⚠️ No Changeset found
Latest commit: ddb641860a1b92a261f0b13f62e59e1a38128fb6
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR