-
-
Notifications
You must be signed in to change notification settings - Fork 249
quest: JS lite fetch waits for the publisher's answer #4175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+33
−0
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # [S] JS lite fetch waits for the publisher's answer | ||
|
|
||
| ## Goal | ||
|
|
||
| `js/net`'s lite `fetchGroup` resolves only once the publisher has answered: | ||
| the first response byte, or a FIN for an empty group. A missing group rejects | ||
| the fetch itself, and every coalesced caller sees the same rejection, instead | ||
| of receiving a group whose first `readFrame()` fails. A JS publisher that | ||
| cannot serve a group resets the stream with `NotFound`, not a generic error, | ||
| so a Rust or JS subscriber can tell a miss from a failure. | ||
|
|
||
| ## Plan | ||
|
|
||
| - Rust already behaves this way since #4164, which waits in the lite | ||
| subscriber before accepting and rejects on reset. Mirror it: resolve after | ||
| the first response byte or an empty-group FIN, and reject on reset. Today | ||
| the fetch path returns its mirror before the response arrives; the stream | ||
| reader can already block until data or FIN and throw on reset. | ||
| - The publisher side throws a plain error for a local miss, which reaches the | ||
| wire as a generic reset code. Give it the `NotFound` code the Rust side uses. | ||
| - The IETF JS path refuses `fetchGroup` outright and is out of scope. | ||
| - Tests in the lite integration suite: a missing group rejects the fetch, a | ||
| coalesced second caller rejects too, an existing group is unchanged, and a | ||
| JS publisher's miss reaches a subscriber as `NotFound`. | ||
|
|
||
| Public API: none; a behavior change in when `fetchGroup` settles. Wire: no | ||
| format change; a miss resets with the existing `NotFound` code instead of a | ||
| generic one. | ||
|
|
||
| ## Related | ||
|
|
||
| - [#4164](https://github.com/moq-dev/moq/pull/4164) - the same fix in Rust | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consumer.fetchGroup()is exported injs/net/src/track.ts, and changing when its promise settles and where a missing-group error surfaces changes its observable contract. Labeling the public API impact asnonecan cause the implementation to skip the required API-impact assessment; describe this as a behavioral public API change instead. (Written by GPT-5.6 Sol)AGENTS.md reference: AGENTS.md:L53-L58
Useful? React with 👍 / 👎.