Unverified Commit 9d3bad7e authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Fix bugs in Event Stream unmarshalling (#736)



* Fix bugs in Event Stream unmarshalling

- S3 Select's `Cont` event doesn't come across with a `:content-type`
  header, but the unmarshaller was expecting this header.
- The unmarshaller attempted to parse events that were modeled as empty
  structs, but S3 sends an empty payload for empty structs rather than
  an empty XML payload conforming to restXml.
- The event stream `Receiver` was returning that there were no more events
  even when it had some remaining events in its buffer.

* Update changelogs

* Incorporate feedback

* Split `smithy_http::event_stream` into multiple modules

* Add another test case to Receiver

* Fix CI

Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
parent 22a77460
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@ vNext (Month Day, Year)

**New this week**
- :bug: Fix an issue where `smithy-xml` may have generated invalid XML (smithy-rs#719)
- :bug: Fix error when receiving empty event stream messages (smithy-rs#736)
- :bug: Fix bug in event stream receiver that could cause the last events in the response stream to be lost (smithy-rs#736)

v0.24 (September 24th, 2021)
============================
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,8 @@ vNext (Month Day, Year)
**New This Week**

- :tada: Add presigned request support and examples for S3 GetObject and PutObject (smithy-rs#731)
- :bug: Fix error when receiving `Cont` event from S3 SelectObjectContent (smithy-rs#736)
- :bug: Fix bug in event stream receiver that could cause the last events in the response stream to be lost when using S3 SelectObjectContent (smithy-rs#736)
- Updated Transcribe code example to take an audio file as a command-line option and added readme.

v0.0.19-alpha (September 24th, 2021)
+1 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ async fn test_success() {
                    stats.bytes_scanned, stats.bytes_processed, stats.bytes_returned
                ))
            }
            SelectObjectContentEventStream::End(_) => {}
            otherwise => panic!("unexpected message: {:?}", otherwise),
        }
    }
+1 −0
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ data class CargoDependency(
        val Hyper: CargoDependency = CargoDependency("hyper", CratesIo("0.14"))
        val HyperWithStream: CargoDependency = Hyper.withFeature("stream")
        val Tower: CargoDependency = CargoDependency("tower", CratesIo("0.4"), optional = true)
        val Tracing: CargoDependency = CargoDependency("tracing", CratesIo("0.1"))
        fun SmithyTypes(runtimeConfig: RuntimeConfig) = runtimeConfig.runtimeCrate("types")

        fun SmithyClient(runtimeConfig: RuntimeConfig) = runtimeConfig.runtimeCrate("client")
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ fun <T : CodeWriter> T.conditionalBlock(
 * Convenience wrapper that tells Intellij that the contents of this block are Rust
 */
fun <T : CodeWriter> T.rust(
    @Language("Rust", prefix = "macro_rules! foo { () =>  {{ ", suffix = "}}}") contents: String,
    @Language("Rust", prefix = "macro_rules! foo { () =>  {{\n", suffix = "\n}}}") contents: String,
    vararg args: Any
) {
    this.write(contents.trim(), *args)
Loading