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 request ID logging for streaming operations #2495

Merged
merged 2 commits into from
Mar 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.next.toml
Original file line number Diff line number Diff line change
@@ -22,3 +22,15 @@ message = "The outputs for event stream operations now implement the `Sync` auto
references = ["smithy-rs#2496"]
meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "all"}
author = "jdisanti"

[[aws-sdk-rust]]
message = "Streaming operations now emit the request ID at the `debug` log level like their non-streaming counterparts."
references = ["smithy-rs#2495"]
meta = { "breaking" = false, "tada" = false, "bug" = true }
author = "jdisanti"

[[smithy-rs]]
message = "Streaming operations now emit the request ID at the `debug` log level like their non-streaming counterparts."
references = ["smithy-rs#2495"]
meta = { "breaking" = false, "tada" = false, "bug" = true, "target" = "client"}
author = "jdisanti"
Original file line number Diff line number Diff line change
@@ -145,6 +145,7 @@ class HttpBoundProtocolTraitImplGenerator(
impl #{ParseResponse} for $operationName {
type Output = std::result::Result<#{O}, #{E}>;
fn parse_unloaded(&self, response: &mut #{operation}::Response) -> Option<Self::Output> {
#{BeforeParseResponse}
// This is an error, defer to the non-streaming parser
if !response.http().status().is_success() && response.http().status().as_u16() != $successCode {
return None;
@@ -161,6 +162,9 @@ class HttpBoundProtocolTraitImplGenerator(
"E" to symbolProvider.symbolForOperationError(operationShape),
"parse_streaming_response" to parseStreamingResponse(operationShape, customizations),
"parse_error" to parseError(operationShape, customizations),
"BeforeParseResponse" to writable {
writeCustomizations(customizations, OperationSection.BeforeParseResponse(customizations, "response"))
},
*codegenScope,
)
}