Fix hangin seek requests#5
Open
lejeunerenard wants to merge 8 commits into
Open
Conversation
The seek requests in the _open'ing of the stream will correctly be cancelled as part of destroying the core. This means they will be uncaught, a change from the start seek in `v2.0.2`.
Without this, the stream could include incorrect `start` & `length` options that cause the `bytes` to seek to for the end to be far past the `id` & even the end of the core. The fix was to cap the end to the max bytes taking the similar approach to how web servers respond to invalid byte ranges in HTTP request. source: https://www.rfc-editor.org/info/rfc9110/#byte.ranges
Recreating behavior for `start` seek in `v2.0.2`.
The test can kill the whole script instead.
mafintosh
reviewed
Jun 13, 2026
| } | ||
|
|
||
| const [start, end] = await Promise.all([this._setStart(), this._prefetch ? this._setEnd() : Promise.resolve(0)]) | ||
| let start, end |
Contributor
There was a problem hiding this comment.
Make two lets, init to 0 also
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 fix prevents throwing an uncaught
REQUEST_CANCELLEDwhen destroying a stream that can't fulfill the seek requests for setting up the stream.Also fixes bug where a combination of custom
start&lengthoptions could request more blocks than necessary for prefetch.Co-written with AI