-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] abort controller issue #1618
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the change is made backwards compatible it should be fine. Could you please add an additional test with the callback to http.spec.js
I fixed a small issue and added 2 tests for the timeout with the getAbortController function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇
fetch, | ||
getAbortController: () => new AbortController(), | ||
}) | ||
nock(testHost) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would move mocking up as the first thing in the test
block.
Hey @tdeekens @jenschude. I'm sorry I've been inactive for a few days. I've noticed that you've made some changes there. Is there anything else I can do? Also, what should I do to get this PR merged? |
Summary
the current version of
createHttpMiddleware
requires a single abortController and uses that for all requests that's why when a single request is getting aborted then all the requests are aborted with it. So my current change is adding a function called getAbortController which returns a new AbortController each time. And I've moved to get the abort controller to the function returned from thecreateHttpMiddleware
.Description
Most probably you'll need to make the abortController property deprecated but I left that decision on you :D.
Todo
Type
label for the PR