-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Streaming uploads cause truncated responses in node 16 #4262
Comments
Thanks for the report! I have investigated the issue and can confirm that there is a bug. This issue is due to the same change in node behavior that prompted #4225 and #4234. While that PR fixes the issue for the common cases, it does not fix it for stream responses. What happens is that hapi will react to the incoming message being closed, and assume that this also applies to the outgoing response. This used to be true in node, but they changed it with v16 so it now closes right after the payload has been delivered. I don't have time to implement a fix, but can inform that Line 260 in b1f6fd6
|
I started digging into this and a question arose pretty quickly: do we believe that this test does not apply to node v16? Line 1193 in b1f6fd6
|
Resolved by #4264, published in v20.1.5 👍 Thanks for the report! |
Support plan
Context
What are you trying to achieve or the steps to reproduce?
Take a look at the following code sample. It starts a server, makes a request to the server, sends some data, and finally prints out the response.
It has two methods of reading the data from the client, one treating
request.payload
as an async iterator, one treating it as a readable stream.On node 16 the
'hello world'
output is not received by the client, on node 14 it is.I think this is something to do with how the request payload is consumed as when you switch the
receiveDataAsAsyncIterator
function out forreceiveDataAsStream
it works as expected on node 14 and node 16.What was the result you got?
Node 14:
Node 16:
The
'hello world'
string is missing from the node 16 output.What result did you expect?
Node 14:
Node 16:
The
'hello world'
string should be included in the node 16 output.The text was updated successfully, but these errors were encountered: