Skip to content

InvokeWithResponseStreamResponseEvent leaks metadata payload into the event stream #1377

@Licenser

Description

@Licenser

Describe the bug

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

  1. set up a lambda with response streaming
  2. call, configure and send invoke_with_response_stream() on a lambda client
  3. call event_stream().recv() on the result
  4. observe that this is the metadata payload not the firs event

Possible Solution

have InvokeWithResponseStreamResponseEvent parse the first message to extract the metadata

Additional Information/Context

No response

Version

aws-sdk-lambda v1.103.0

Environment details (OS name and version, etc.)

MacOs

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions