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: correctly handle error events that happen after response events #14

Closed
wants to merge 8 commits into from

Conversation

nlf
Copy link
Contributor

@nlf nlf commented Jul 1, 2021

i wrote a pretty long comment in the code to be sure that the error propagation never gets accidentally removed, and we remember to account for this situation when we eventually refactor this.

this resolves a lot of the cb() never called errors, especially those in Windows where i was able to reproduce the bug pretty easily. i suspect there's a similar issue in other operating systems, but was unable to prove it. similarly testing this proved somewhat difficult since the underlying request object is inaccessible from the response object the promise resolves to, so there isn't an easy way to manually trigger this problem.

this code is definitely due some refactoring, and as part of that it would be nice to allow access to the raw request and response objects so that we can test this accurately, but that work should not delay getting this fix released.

@nlf nlf force-pushed the nlf/forward-request-errors branch 5 times, most recently from 72a6096 to 7daaa51 Compare July 2, 2021 21:06
@nlf nlf force-pushed the nlf/forward-request-errors branch from 5534dbe to a3b722c Compare July 2, 2021 21:20
this is due to the lack of brotli support, which we cannot cover without
mocking an entire brotli stream, which is far outside the scope of reason

PR-URL: #14
Credit: @nlf
Close: #14
Reviewed-by: @wraithgar
@nlf nlf force-pushed the nlf/forward-request-errors branch from a3b722c to 9c1c80b Compare July 15, 2021 17:23
@nlf nlf closed this in 9c1c80b Jul 15, 2021
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.

2 participants