awslabs / awslabs/aws-sdk-rust
`InvokeWithResponseStreamResponseEvent` leaks metadata payload into the event stream
- Dominant language
- Rust
- Stars
- 3.3k
- Forks
- 290
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 3
Description
### 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
0) set up a lambda with response streaming
1) call, configure and send `invoke_with_response_stream()` on a lambda client
2) call `event_stream().recv()` on the result
3) 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
```text
aws-sdk-lambda v1.103.0
```
### Environment details (OS name and version, etc.)
MacOs
### Logs
_No response_
Contributor guide
Research direction
Start by inspecting the InvokeWithResponseStreamResponseEvent implementation and reproduce the issue with invoke_with_response_stream() and event_stream().recv(). Done means the first recv() result excludes the metadata payload and trailing zeros, returning the first actual event instead.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, rust
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100