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 request cancellation on timeout #238

Merged
merged 1 commit into from Feb 22, 2020

Conversation

sholladay
Copy link
Collaborator

Fixes #221

This PR fixes a regression that was caused by a simple refactoring mistake in PR #180, which caused the request to not be aborted after a TimeoutError.

Unfortunately, while I did confirm that it works, I haven't figured out how to write a test for it. I was expecting that the abort operation would cause the client to hang up the connection, and I figured that would cause an error event on the test server's request object that I could watch for. But the abort doesn't seem to cause such an error to occur. I'm not familiar enough with the details of what AbortController does at the network connection / HTTP layer to know if there's anything else to look for.

@sindresorhus
Copy link
Owner

I haven't figured out how to write a test for it. I was expecting that the abort operation would cause the client to hang up the connection

Can you open an issue about writing a test for this? So we'll get to it eventually.

@sholladay
Copy link
Collaborator Author

Can you open an issue ...

Done: #239

@sindresorhus sindresorhus merged commit 041e935 into sindresorhus:master Feb 22, 2020
@sindresorhus
Copy link
Owner

Great. Thanks for fixing this.

Would you be able to take a quick look at #235? I'd like to get out a new version today.

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

Successfully merging this pull request may close these issues.

Request not cancelled when timeout occurs
2 participants