-
Notifications
You must be signed in to change notification settings - Fork 37
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
🕳 Implement finish
semantics for streaming bodies
#203
Conversation
7fbb42e
to
d324cb9
Compare
Note that we are not ready to cut a release including these changes, so we should probably hold off on merging until then. But the changes are ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks fantastic @acfoltzer, thank you for handling this tricky issue!
Moving forward, streaming bodies must be affirmatively finished when Wasm programs are finished writing to them. This helps prevent unexpected control flows due to error handling causing an incomplete `transfer-encoding: chunked` streaming body from appearing complete to its recipient. These changes require updates to the integration test fixtures with a prerelease version of the SDK. Once the 0.9.0 Rust SDK is released, we'll follow up with an update to the released version.
d324cb9
to
b642740
Compare
@cratelyn I prematurely retagged you on this... my plan is to do the 0.9.0 release, update the test fixtures' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️ this looks great! i have just one tiny optional nitpick about imports, take it or leave it. thank you for doing this @acfoltzer!
lib/src/body.rs
Outdated
use crate::streaming_body::StreamingBodyItem; | ||
use crate::Error; | ||
|
||
use { | ||
crate::error, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, nit: can we squish this into the use
below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 5f2d111. Do you know if there's a combination of settings that would get rust-analyzer
to insert imports this way? https://rust-analyzer.github.io/manual.html#auto-import
I tend to exclusively use the auto-import feature without even looking at what it inserts, which is how I missed this inconsistency.
Please hold... I will update the lockfiles once we have 0.9.1 out the door 😞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Moving forward, streaming bodies must be affirmatively finished when Wasm programs are finished writing to them. This helps prevent unexpected control flows due to error handling causing an incomplete
transfer-encoding: chunked
streaming body from appearing complete to its recipient.These changes require updates to the integration test fixtures with a prerelease version of the SDK. Once the 0.9.0 Rust SDK is released, we'll follow up with an update to the released version.