Skip to content
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

Merged
merged 4 commits into from
Sep 28, 2020
Merged

[fix] abort controller issue #1618

merged 4 commits into from
Sep 28, 2020

Conversation

hakobpogh
Copy link
Contributor

@hakobpogh hakobpogh commented Sep 11, 2020

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 the createHttpMiddleware.

Description

Most probably you'll need to make the abortController property deprecated but I left that decision on you :D.

Todo

  • Tests
    • Unit
    • Integration
    • Acceptance
  • Documentation
  • Type label for the PR

Copy link
Contributor

@jenschude jenschude left a 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

@tdeekens tdeekens removed their request for review September 21, 2020 09:11
@jenschude
Copy link
Contributor

I fixed a small issue and added 2 tests for the timeout with the getAbortController function

Copy link
Contributor

@tdeekens tdeekens left a 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)
Copy link
Contributor

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.

@hakobpogh
Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants