Repository navigation
Conversation
Flush gzip and Brotli response compressors after each successful write for text/event-stream bodies. This lets clients decode complete events before the response ends while retaining normal buffering for other compressed responses. Cover codec behavior, failure propagation, deferred proxy execution, and end-to-end response delivery.
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
|
@bsobel-cf Bonk workflow was cancelled. View workflow run · To retry, trigger Bonk again. |
jasnell
self-requested a review
September 17, 2026 02:44
jasnell
reviewed
Oct 10, 2026
Comment on lines
+191
to
+193
| auto promise = compressor.write(buffer); | ||
| return flushAfterWrite ? promise.then([this]() { return compressor.flush(); }) | ||
| : kj::mv(promise); |
Collaborator
There was a problem hiding this comment.
Nit: this could be a coroutine to prevent the this capture in the lambda.
jasnell
approved these changes
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Compressed
text/event-streamresponses can remain buffered inside gzip or Brotli encoders after an application writes a complete event, preventing clients from decoding that event until more output arrives or the response ends.Flush gzip and Brotli encoders after each successful write for compressed Server-Sent Event bodies. Identity-encoded Server-Sent Events retain their existing behavior, and compressed non-SSE responses retain normal buffering. Flush failures propagate through the write operation.
Testing
system-streams-test, five runsdeferred-proxy-flow-test, five runsserver-test, five runssystem-streams-test, five uncached runs