Fix cancelPromise in ReadableStreamTee being resolved twice #1112
Merged
domenic merged 5 commits intoMar 20, 2021
Conversation
Collaborator
Author
|
I would also have expected this assertion failure to cause the WPT test run to fail, but instead it only logged the error without failing the tests?! Not sure why that's not working... 😕 |
Member
|
Probably something broken in wpt-runner :( |
Collaborator
Author
Yup, domenic/wpt-runner#22. 😉 |
Collaborator
Author
|
We're finding all sorts of unexpected errors today! 😁 Looks like this cleanup function is failing because we forgot to add |
domenic
approved these changes
Mar 20, 2021
Member
|
It looks like the WPT caught a Safari bug; do you mind filing it and updating the OP to link to it? |
Collaborator
Author
|
Done! 🙂 |
3 tasks
aarongable
pushed a commit
to chromium/chromium
that referenced
this pull request
Apr 1, 2022
This change addresses the issue of resolving an already resolved |cancelPromise| in ReadableStreamTee, by checking if both branches have already been canceled. If that is the case, we will have already resolved |cancelPromise| and don't need to resolve it again. The corresponding specification changes are: - whatwg/streams#1112 - whatwg/streams#1118 Bug: 1194266 Change-Id: Iccd6917c1ed98ea5677ba71e050a5f07a5b2b6ed Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3565500 Reviewed-by: Adam Rice <[email protected]> Commit-Queue: Nidhi Jaju <[email protected]> Cr-Commit-Position: refs/heads/main@{#987847}
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.
The following test is throwing an
AssertionError:This can be seen in our CI logs, e.g. the latest run on
master:which refers to this line in the reference implementation:
This indicates that we're attempting to resolve an already resolved promise. Although implementers are required to ignore such attempts, we try to avoid doing this in the specification, which is why we added this check in #1102. Unfortunately, it looks like we missed a case where this assertion fails...
This PR fixes it by checking if both branches have already been canceled in "upon rejection of reader.[[closedPromise]]". If that's the case, then we will have already resolved
cancelPromiseand we don't need to resolve it again.(See WHATWG Working Mode: Changes for more details.)
Preview | Diff