You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
InvokeWithResponseStreamResponseEvent leaks metadata payload into the event stream #1377
InvokeWithResponseStreamResponseEvent leaks the initial metadata payload, and the trailing zeros into the event stream.
This seems wrong since as both the documentation and the function names suggest the metadata payload is distinct, well known, and part of the API not part of the events.
Regression Issue
Select this option if this issue appears to be a regression.
Expected Behavior
When reading the events from InvokeWithResponseStreamResponseEvent the metadata payload is not included but handled by InvokeWithResponseStreamResponseEvent internally.
Current Behavior
The first call of recv() returns the metadata payload json and the 8 trailing zeros
Reproduction Steps
set up a lambda with response streaming
call, configure and send invoke_with_response_stream() on a lambda client
call event_stream().recv() on the result
observe that this is the metadata payload not the firs event
Possible Solution
have InvokeWithResponseStreamResponseEvent parse the first message to extract the metadata
I can't speak to 102 as I only started to use streaming the 103 release. The data has no headers. The event received is of the type InvokeWithResponseStreamResponseEvent::PayloadChunk which contains a InvokeResponseStreamUpdate that contains only one field payload which is a Option<Blob> where Blob is a wrapper around a Vec<u8>.
No functionality is provided to disninguish the initial payload metadata message from the payload itself. It isn't always a single event either. I've seen the metadata and the trailing eight 0 bytes being in a single or multiple events.
I first thought that a difference in code between aws-sdk-lambda 1.102.0 and 1.103.0 might have something to with this, but invoke_with_response_stream in both versions should behave the same at the end of the day.
Do you see this issue from any lambda function with response streaming, not just the one in question?
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
Activity
ysaito1001 commentedon Nov 6, 2025
Thank you for reporting this issue. This appears to be a regression introduced in
aws-sdk-lambda1.103.0.The previous version (1.102.0) didn't handle initial-message in the response, which is expected behavior for non-rpc-bound protocols like restJson1.
However, starting with version 1.103.0, the code began handling initial responses, which introduced this regression.
ysaito1001 commentedon Nov 6, 2025
Just to double-check, do you see the same issue in the previous version of
aws-sdk-lambda1.102.0?Also, does the message containing what you refer to as payload metadata include the header
:event-typewith the valueinitial-response?Licenser commentedon Nov 7, 2025
I can't speak to 102 as I only started to use streaming the 103 release. The data has no headers. The event received is of the type
InvokeWithResponseStreamResponseEvent::PayloadChunkwhich contains aInvokeResponseStreamUpdatethat contains only one fieldpayloadwhich is aOption<Blob>whereBlobis a wrapper around aVec<u8>.No functionality is provided to disninguish the initial payload metadata message from the payload itself. It isn't always a single event either. I've seen the metadata and the trailing eight 0 bytes being in a single or multiple events.
ysaito1001 commentedon Nov 7, 2025
I've tried reproducing what you observed using
aws-sdk-lambda1.103.0, but haven't been able to:example code
lambda: yield-chunks
Got this response, with no metadata leaked:
I first thought that a difference in code between
aws-sdk-lambda1.102.0 and 1.103.0 might have something to with this, butinvoke_with_response_streamin both versions should behave the same at the end of the day.Do you see this issue from any lambda function with response streaming, not just the one in question?
github-actions commentedon Nov 17, 2025
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.
Licenser commentedon Nov 19, 2025
This isn't something that happens every time sadly, we only saw a few percent of requests show this issue
ysaito1001 commentedon Nov 25, 2025
Since we haven't been able to reproduce this issue on our end, we'd appreciate your help with one of the following:
Either approach would help us move forward with resolving this.
Licenser commentedon Nov 26, 2025
Heya, this lambda should create the mix of the prelude and the main response: