Unverified Commit 66a0855b authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Fix execution order of `read_before_serialization` and `modify_before_serialization` (#3798)

## Motivation and Context
Fixes the execution order of
[modify_before_serialization](https://docs.rs/aws-smithy-runtime-api/latest/aws_smithy_runtime_api/client/interceptors/trait.Intercept.html#method.modify_before_serialization)
and
[read_before_serialization](https://docs.rs/aws-smithy-runtime-api/latest/aws_smithy_runtime_api/client/interceptors/trait.Intercept.html#method.read_before_serialization)
in the orchestrator.

## Description
The fix ensures that the execution order of these interceptor methods
aligns with our orchestrator design. While customers may see a behavior
change as a result, we don't treat this as a new `BehaviorVersion` since
it is intended as a bug fix.

## Testing
Existing tests in CI

## Checklist
- [x] For changes to the smithy-rs codegen or runtime crates, I have
created a changelog entry Markdown file in the `.changelog` directory,
specifying "client," "server," or both in the `applies_to` key.
- [x] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 84111a0d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
---
applies_to:
- client
- aws-sdk-rust
authors:
- ysaito1001
references:
- smithy-rs#3798
breaking: false
new_feature: false
bug_fix: true
---
Fix the execution order of [modify_before_serialization](https://docs.rs/aws-smithy-runtime-api/latest/aws_smithy_runtime_api/client/interceptors/trait.Intercept.html#method.modify_before_serialization) and [read_before_serialization](https://docs.rs/aws-smithy-runtime-api/latest/aws_smithy_runtime_api/client/interceptors/trait.Intercept.html#method.read_before_serialization) in the orchestrator. The `modify_before_serialization` method now executes before the `read_before_serialization` method. This adjustment may result in changes in behavior depending on how you customize interceptors.
+20 −19
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ dependencies = [
name = "aws-smithy-cbor"
version = "0.60.7"
dependencies = [
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "criterion",
 "minicbor",
]
@@ -337,7 +337,7 @@ name = "aws-smithy-checksums"
version = "0.60.12"
dependencies = [
 "aws-smithy-http 0.60.9",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "bytes",
 "bytes-utils",
 "crc32c",
@@ -364,7 +364,7 @@ name = "aws-smithy-compression"
version = "0.0.1"
dependencies = [
 "aws-smithy-runtime-api 1.7.2",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "bytes",
 "bytes-utils",
 "flate2",
@@ -384,7 +384,7 @@ name = "aws-smithy-eventstream"
version = "0.60.4"
dependencies = [
 "arbitrary",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "bytes",
 "bytes-utils",
 "crc32fast",
@@ -407,9 +407,9 @@ name = "aws-smithy-experimental"
version = "0.1.4"
dependencies = [
 "aws-smithy-async 1.2.1",
 "aws-smithy-runtime 1.6.3",
 "aws-smithy-runtime 1.7.0",
 "aws-smithy-runtime-api 1.7.2",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "h2 0.4.5",
 "http 1.1.0",
 "hyper 1.4.1",
@@ -451,7 +451,7 @@ dependencies = [
 "async-stream",
 "aws-smithy-eventstream 0.60.4",
 "aws-smithy-runtime-api 1.7.2",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "bytes",
 "bytes-utils",
 "futures-core",
@@ -480,7 +480,7 @@ dependencies = [
 "aws-smithy-http 0.60.9",
 "aws-smithy-json 0.60.7",
 "aws-smithy-runtime-api 1.7.2",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "aws-smithy-xml 0.60.8",
 "bytes",
 "futures-util",
@@ -510,7 +510,7 @@ dependencies = [
 "aws-smithy-http 0.60.9",
 "aws-smithy-http-server",
 "aws-smithy-json 0.60.7",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "aws-smithy-xml 0.60.8",
 "bytes",
 "futures",
@@ -550,7 +550,7 @@ version = "0.60.3"
name = "aws-smithy-json"
version = "0.60.7"
dependencies = [
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "proptest",
 "serde_json",
]
@@ -570,7 +570,7 @@ version = "0.2.1"
dependencies = [
 "aws-sdk-s3",
 "aws-smithy-runtime-api 1.7.2",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "tokio",
]

@@ -611,7 +611,7 @@ dependencies = [
name = "aws-smithy-query"
version = "0.60.7"
dependencies = [
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "urlencoding",
]

@@ -648,14 +648,14 @@ dependencies = [

[[package]]
name = "aws-smithy-runtime"
version = "1.6.3"
version = "1.7.0"
dependencies = [
 "approx",
 "aws-smithy-async 1.2.1",
 "aws-smithy-http 0.60.9",
 "aws-smithy-protocol-test 0.62.0",
 "aws-smithy-runtime-api 1.7.2",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "bytes",
 "fastrand",
 "futures-util",
@@ -703,7 +703,7 @@ name = "aws-smithy-runtime-api"
version = "1.7.2"
dependencies = [
 "aws-smithy-async 1.2.1",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "bytes",
 "http 0.2.12",
 "http 1.1.0",
@@ -742,7 +742,7 @@ dependencies = [

[[package]]
name = "aws-smithy-types"
version = "1.2.2"
version = "1.2.3"
dependencies = [
 "base64 0.13.1",
 "base64-simd",
@@ -779,7 +779,7 @@ name = "aws-smithy-types-convert"
version = "0.60.8"
dependencies = [
 "aws-smithy-async 1.2.1",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "chrono",
 "futures-core",
 "time",
@@ -791,7 +791,7 @@ version = "0.1.3"
dependencies = [
 "aws-smithy-http 0.60.9",
 "aws-smithy-runtime-api 1.7.2",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "bytes",
 "http 1.1.0",
 "tracing",
@@ -1979,8 +1979,9 @@ dependencies = [
 "aws-smithy-compression",
 "aws-smithy-http 0.60.9",
 "aws-smithy-json 0.60.7",
 "aws-smithy-runtime 1.7.0",
 "aws-smithy-runtime-api 1.7.2",
 "aws-smithy-types 1.2.2",
 "aws-smithy-types 1.2.3",
 "aws-smithy-xml 0.60.8",
 "bytes",
 "fastrand",
+1 −1
Original line number Diff line number Diff line
[package]
name = "aws-smithy-runtime"
version = "1.6.4"
version = "1.7.0"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>", "Zelda Hessler <zhessler@amazon.com>"]
description = "The new smithy runtime crate"
edition = "2021"
+1 −1
Original line number Diff line number Diff line
@@ -217,8 +217,8 @@ async fn try_op(
) {
    // Before serialization
    run_interceptors!(halt_on_err: {
        read_before_serialization(ctx, runtime_components, cfg);
        modify_before_serialization(ctx, runtime_components, cfg);
        read_before_serialization(ctx, runtime_components, cfg);
    });

    // Serialization