fix(cache): preserve 304 response event order with async stores - #5797
Open
marcopiraccini wants to merge 2 commits into
Open
fix(cache): preserve 304 response event order with async stores#5797marcopiraccini wants to merge 2 commits into
marcopiraccini wants to merge 2 commits into
Conversation
marcopiraccini
marked this pull request as draft
September 10, 2026 08:41
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5797 +/- ##
==========================================
+ Coverage 93.52% 93.56% +0.03%
==========================================
Files 110 110
Lines 39414 39451 +37
==========================================
+ Hits 36863 36911 +48
+ Misses 2551 2540 -11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
marcopiraccini
marked this pull request as ready for review
September 10, 2026 09:26
metcoder95
reviewed
Sep 10, 2026
| // when stream is full stop writing until we get a 'drain' event | ||
| if (full) { | ||
| break | ||
| return new Promise((resolve) => { |
Member
There was a problem hiding this comment.
I'd prefer if we use a callback instead of creating a new Promise; in that way, regardless of the nature, we minimize overhead as well keep things a bit consistent.
Member
There was a problem hiding this comment.
I don't think it's the contract.
mcollina
requested changes
Sep 11, 2026
| // when stream is full stop writing until we get a 'drain' event | ||
| if (full) { | ||
| break | ||
| return new Promise((resolve) => { |
Member
There was a problem hiding this comment.
I don't think it's the contract.
|
|
||
| onResponseData (controller, chunk) { | ||
| if (this.#pending304) { | ||
| this.#pending304 = this.#pending304.then(() => this.onResponseData(controller, chunk)) |
Member
There was a problem hiding this comment.
this create an infinite chain of pending promises
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.
This relates to...
N/A
Rationale
When a 304 response is delivered synchronously while using an asynchronous cache store, the response can end before the store lookup completes. This causes downstream handlers to receive response events out of order and can prevent the cached body from being replayed.
Changes
Features
N/A
Bug Fixes
Breaking Changes and Deprecations
N/A
Status