fix(api): correct ReadableStreamDefaultController.desiredSize value type#44536
Open
gords2 wants to merge 1 commit into
Open
fix(api): correct ReadableStreamDefaultController.desiredSize value type#44536gords2 wants to merge 1 commit into
gords2 wants to merge 1 commit into
Conversation
desiredSize is not always an integer: with a custom queuing strategy the chunk sizes (and therefore desiredSize) can be non-integer. It is also null when the stream has errored and 0 when it is closed.
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.
Fixes #44486
The Value section claimed
desiredSizeis "An integer", which is inaccurate on two counts (both raised in the issue):null—ReadableStreamDefaultController.desiredSizereturnsnullwhen the stream has errored (and0when it is closed), per the spec algorithm.desiredSizefrom the queuing strategy'ssize()results. A custom queuing strategy can return non-integer sizes, sodesiredSizecan be non-integer too.Updated the description to state the type as "A number, or
null" and to explain the negative / non-integer / null / closed cases.