Skip to content

doc: document quic stopSending() and resetStream() - #64888

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
theSnackOverflow:quic-doc-stopsending-resetstream
Aug 8, 2026
Merged

doc: document quic stopSending() and resetStream()#64888
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
theSnackOverflow:quic-doc-stopsending-resetstream

Conversation

@theSnackOverflow

@theSnackOverflow theSnackOverflow commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Fixes: #63680

QuicStream.prototype.stopSending() and QuicStream.prototype.resetStream()
are part of the public surface but were missing from the QuicStream reference.

The wording follows the JSDoc already on the implementation:

node/lib/internal/quic/quic.js

Lines 2411 to 2435 in 8a1ca0f

/**
* Tells the peer to stop sending data for this stream. The optional error
* code will be sent to the peer as part of the request. If the stream is
* already destroyed, this is a no-op. No acknowledgement of this action
* will be provided.
* @param {number|bigint} code
*/
stopSending(code = 0n) {
assertIsQuicStream(this);
if (this.destroyed) return;
this.#handle.stopSending(BigInt(code));
}
/**
* Tells the peer that this end will not send any more data on this stream.
* The optional error code will be sent to the peer as part of the
* request. If the stream is already destroyed, this is a no-op. No
* acknowledgement of this action will be provided.
* @param {number|bigint} code
*/
resetStream(code = 0n) {
assertIsQuicStream(this);
if (this.destroyed) return;
this.#handle.resetStream(BigInt(code));
}

I also added both to the Aborting a stream section, which listed only
writer.fail() and stream.destroy(). The distinction seemed worth calling
out: those two derive the wire code from an error (falling back to the
protocol's "internal error" code), while stopSending() and resetStream()
send the given code as-is.

added: is set to v23.8.0, matching the rest of the file — both methods were
introduced in 062ae6f, the same commit that created doc/api/quic.md, and
were simply omitted from it. Happy to change this if a different version is
more accurate.

Verification

doc/api/quic.md is in skip_apidoc_files (Makefile), so it is not part of the
HTML/JSON doc build and make doc-only does not exercise it. Validation was
therefore limited to:

  • node tools/lint-md/lint-md.mjs doc/api/quic.md — clean
  • python3 tools/test.py doctool — 3/3 passing
  • Anchors follow the file's existing convention (stream.setPriority([options])
    #streamsetpriorityoptions)

Note

This supersedes #63681, which covered the same issue but was closed without
landing.

Update

Added a second commit covering behaviour the first one missed:

  • resetStream() discards any data still queued for sending, and is a no-op
    once the stream has already been reset.
  • Neither method sends a frame on the unidirectional stream that lacks the side
    it aborts — stopSending() on a locally-initiated one, resetStream() on a
    remote-initiated one. Both fail silently there.

Verified against Stream::DoStreamReset and Stream::SendStopSending in
src/quic/streams.cc. The directionality wording follows stream.destroy(),
which already frames the readable side as existing on bidirectional and
remote-initiated unidirectional streams.

I left the valid range of code undocumented on purpose: the binding reads it
with Uint64Value() and discards the lossless flag, so out-of-range values are
silently truncated rather than rejected. Documenting a 62-bit limit would state
a contract the implementation does not currently enforce. Happy to open that
separately if it's worth tracking.

`QuicStream` exposes `stopSending()` and `resetStream()`, but neither
appeared in the QuicStream API reference. Both matter when half-closing
a stream, which protocols such as WebTransport rely on.

Document the two methods and list them in the "Aborting a stream"
summary, which previously covered only `writer.fail()` and
`stream.destroy()`. Unlike those, both send the given code as-is rather
than deriving a wire code from an error.

Fixes: nodejs#63680
Signed-off-by: Ji Hoon Kang <ivory.ma9ic@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/quic

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. quic Issues and PRs related to the QUIC implementation / HTTP/3. labels Aug 1, 2026
The reference added earlier in this pull request described only the
bidirectional happy path. Three behaviours were missing:

* `resetStream()` discards any data still queued for sending. A reset
  stream is never acknowledged, so that queue can no longer drain.
* `resetStream()` is a no-op once the stream has already been reset.
* Neither method sends a frame on the unidirectional stream that lacks
  the side it aborts — `stopSending()` on a locally-initiated one,
  `resetStream()` on a remote-initiated one. Both fail silently there.

The wording for stream directionality follows `stream.destroy()`, which
already states that the readable side exists on bidirectional and
remote-initiated unidirectional streams.

Refs: nodejs#63680
Signed-off-by: Ji Hoon Kang <ivory.ma9ic@gmail.com>

@jasnell jasnell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the caveat that the details on this may continue to change, LGTM

@jasnell jasnell added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 8, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 8, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/64888
✔  Done loading data for nodejs/node/pull/64888
----------------------------------- PR info ------------------------------------
Title      doc: document quic stopSending() and resetStream() (#64888)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     theSnackOverflow:quic-doc-stopsending-resetstream -> nodejs:main
Labels     doc, quic
Commits    2
 - doc: document quic stopSending() and resetStream()
 - doc: note quic reset and unidirectional edge cases
Committers 1
 - Ji Hoon Kang <ivory.ma9ic@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64888
Fixes: https://github.com/nodejs/node/issues/63680
Reviewed-By: James M Snell <jasnell@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/64888
Fixes: https://github.com/nodejs/node/issues/63680
Reviewed-By: James M Snell <jasnell@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sat, 01 Aug 2026 00:15:21 GMT
   ✔  Approvals: 1
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/64888#pullrequestreview-4889029982
   ✔  Last GitHub CI successful
   ℹ  Green GitHub CI is sufficient
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 64888
From https://github.com/nodejs/node
 * branch                  refs/pull/64888/merge -> FETCH_HEAD
✔  Fetched commits as 347e26618740..8784c5a601b5
--------------------------------------------------------------------------------
Auto-merging doc/api/quic.md
[main 37b84fb75a] doc: document quic stopSending() and resetStream()
 Author: Ji Hoon Kang <ivory.ma9ic@gmail.com>
 Date: Sat Aug 1 09:09:08 2026 +0900
 1 file changed, 43 insertions(+), 1 deletion(-)
Auto-merging doc/api/quic.md
[main 4b0921f58d] doc: note quic reset and unidirectional edge cases
 Author: Ji Hoon Kang <ivory.ma9ic@gmail.com>
 Date: Sun Aug 2 22:43:42 2026 +0900
 1 file changed, 9 insertions(+), 4 deletions(-)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
(node:486) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Rebasing (2/4)
Executing: git node land --amend --yes
   ⚠  Found Fixes: https://github.com/nodejs/node/issues/63680, skipping..
--------------------------------- New Message ----------------------------------
doc: document quic stopSending() and resetStream()

QuicStream exposes stopSending() and resetStream(), but neither
appeared in the QuicStream API reference. Both matter when half-closing
a stream, which protocols such as WebTransport rely on.

Document the two methods and list them in the "Aborting a stream"
summary, which previously covered only writer.fail() and
stream.destroy(). Unlike those, both send the given code as-is rather
than deriving a wire code from an error.

Fixes: #63680
Signed-off-by: Ji Hoon Kang <ivory.ma9ic@gmail.com>
PR-URL: #64888
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD 326c8bcdba] doc: document quic stopSending() and resetStream()
Author: Ji Hoon Kang <ivory.ma9ic@gmail.com>
Date: Sat Aug 1 09:09:08 2026 +0900
1 file changed, 43 insertions(+), 1 deletion(-)
Rebasing (3/4)
Rebasing (4/4)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
doc: note quic reset and unidirectional edge cases

The reference added earlier in this pull request described only the
bidirectional happy path. Three behaviours were missing:

  • resetStream() discards any data still queued for sending. A reset
    stream is never acknowledged, so that queue can no longer drain.
  • resetStream() is a no-op once the stream has already been reset.
  • Neither method sends a frame on the unidirectional stream that lacks
    the side it aborts — stopSending() on a locally-initiated one,
    resetStream() on a remote-initiated one. Both fail silently there.

The wording for stream directionality follows stream.destroy(), which
already states that the readable side exists on bidirectional and
remote-initiated unidirectional streams.

Refs: #63680
Signed-off-by: Ji Hoon Kang <ivory.ma9ic@gmail.com>
PR-URL: #64888
Fixes: #63680
Reviewed-By: James M Snell <jasnell@gmail.com>

[detached HEAD 7526d888e3] doc: note quic reset and unidirectional edge cases
Author: Ji Hoon Kang <ivory.ma9ic@gmail.com>
Date: Sun Aug 2 22:43:42 2026 +0900
1 file changed, 9 insertions(+), 4 deletions(-)
Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/31263403525

@theSnackOverflow

theSnackOverflow commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

The commit queue stopped because this PR has two commits and no landing strategy label, so it fell through to the default --oneCommitMax in tools/actions/commit-queue.sh:

Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

Squashing into a single commit is fine by me — the second commit only extends the same reference section the first one added, so there is no reason to keep them apart in history.

Whenever convenient, this needs both commit-queue-squash and commit-queue re-added, since the queue selects on the latter and the bot removed it on the failed run. Thanks for the review.

@jasnell jasnell added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Aug 8, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 8, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 2921232 into nodejs:main Aug 8, 2026
30 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 2921232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. doc Issues and PRs related to the documentations. quic Issues and PRs related to the QUIC implementation / HTTP/3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quic: QuicStream missing docu for stopSending, and resetStream

3 participants