-
-
Notifications
You must be signed in to change notification settings - Fork 127
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 pending requests when the interceptor is disposed #393
base: main
Are you sure you want to change the base?
Conversation
Let's have a discussion on this one, I think I know how we can approach it in an elegant manner. Will gather my thoughts and post here once I have a minute. |
@kettanaito do you think you can find some time in the coming weeks to handle this PR ? I think I can allocate an afternoon next week if you want to discuss this. |
Wanted to voice my support for this. As being able to test abort controllers is an important part of unit testing. Hoping this PR solves mswjs/msw#1646 |
Copying my 2cents here as well... I think this change really should be in the Check out mswjs/msw#778 for a more full discussion. |
@howagain MSW 2.0 includes my first PR that fixes AbortSignal. So if you manually abort the request, you should be able to test that. This could be a nice improvement to build on top of this PR. Although, given that this PR has not been merged after 5 months, I will not go further before it has been merged. Maintainers have a limited bandwidth. I understand it can be frustrating but we are working hundreds of hours for the benefits of strangers on the internet. For free. Be kind ❤️ |
This PR aims to solve issue mswjs/msw#778.
I took the following approach :
Unhandled requests are not affected.
Since this only affects Node.js, I implemented the logic into
FetchInterceptor
andClientRequestInterceptor