Skip to content

quic: handle application-specific no-error codes - #67094

Merged
nodejs-github-bot merged 6 commits into
nodejs:mainfrom
efekrskl:quic/error-mismatch
Nov 18, 2026
Merged

nodejs-github-bot merged 6 commits into
nodejs:mainfrom
efekrskl:quic/error-mismatch

Conversation

@efekrskl

Copy link
Copy Markdown
Member

This started as a consistency fix between Session::EmitClose() and Stream::EmitClose().

Before this change, three places decided whether a QUIC application code meant an error, and they did not agree. Session close only considered code 0 clean, so an HTTP/3 peer closing with H3_NO_ERROR (0x100) could reject session.closed. Stream handling recognized H3_NO_ERROR in C++, but JavaScript later treated any non-zero reset code as an error. As a result, a clean HTTP/3 reset could still reject stream.closed or fail a read.

The underlying QuicError conversion also hardcoded HTTP/3 values without knowing which protocol had been selected. This change moves that decision to code that has that information:

  • Raw QUIC keeps 0 as its no-error code.
  • HTTP/3 treats H3_NO_ERROR and unknown or reserved codes as no error, as required by RFC 9114.
  • Known HTTP/3 errors, including H3_DATAGRAM_ERROR, remain errors.

QuicError now preserves the original type and code. Sessions and streams use the selected protocol to interpret them, and JavaScript no longer guesses based on whether the number is zero.

AI assistance: I used Codex's assistance for the investigation/PR

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/quic

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC transport implementation. labels Oct 28, 2026
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.66%. Comparing base (40b49b6) to head (a8c0f42).
⚠️ Report is 88 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67094      +/-   ##
==========================================
- Coverage   92.62%   90.66%   -1.97%     
==========================================
  Files         432      799     +367     
  Lines      197476   280284   +82808     
  Branches    30129    54135   +24006     
==========================================
+ Hits       182917   254120   +71203     
- Misses      14231    16288    +2057     
- Partials      328     9876    +9548     
Files with missing lines Coverage Δ
lib/internal/quic/quic.js 100.00% <100.00%> (ø)
lib/internal/quic/state.js 100.00% <100.00%> (ø)

... and 523 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pimterry pimterry 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.

Onboard with the general concept, code looks good to me, but I think the undefined error code is worth looking at. Even though it's preexisting, this makes it much broader since it now covers all unknown H3 codes - all unknown h3 codes are exposed as undefined instead of their raw values.

Comment thread doc/api/quic.md Resolved
Comment thread doc/api/quic.md Resolved
@efekrskl
efekrskl force-pushed the quic/error-mismatch branch from a25558d to d8ceea3 Compare November 13, 2026 18:49
@efekrskl
efekrskl requested a review from pimterry November 13, 2026 19:59
@jasnell jasnell moved this to Ready for Review in QUIC Team Nov 14, 2026
@pimterry pimterry added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 16, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 16, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@efekrskl efekrskl added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 16, 2026
@pimterry pimterry added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 17, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@efekrskl efekrskl added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 17, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. and removed commit-queue PRs queued for automated landing through the Commit Queue. labels Nov 17, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Commit Queue failed

This pull request has multiple commits, but no landing policy was selected.

Add commit-queue-squash PRs the Commit Queue should land as one squashed commit. to land it as one commit, or commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. to land the commits separately.

The pull request was removed from the Commit Queue and labeled commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. . After resolving the failure, remove that label and add commit-queue PRs queued for automated landing through the Commit Queue. to retry.

Full Commit Queue output
�[36m⠋�[39m Loading data for nodejs/node/pull/67094
�[36m⠋�[39m Loading data for nodejs/node/pull/67094
�[36m⠋�[39m Getting collaborator contacts from README of nodejs/node
�[36m⠋�[39m Getting PR from nodejs/node/pull/67094
�[36m⠋�[39m Getting reviews from nodejs/node/pull/67094
�[36m⠋�[39m Getting comments from nodejs/node/pull/67094
�[36m⠋�[39m Getting commits from nodejs/node/pull/67094
✔  Done loading data for nodejs/node/pull/67094
----------------------------------- PR info ------------------------------------
Title      quic: handle application-specific no-error codes (#67094)
   ⚠  Could not retrieve the email or name of the PR's author from user's GitHub profile!
Branch     efekrskl:quic/error-mismatch -> nodejs:main
Labels     c++, needs-ci, quic, commit-queue
Commits    6
 - quic: handle application-specific no-error codes
 - quic: fmt
 - quic: revert incorrect adjustment and fix docs
 - quic: handle stop sending
 - quic: lint
 - quic: fix no crypto build
Committers 1
 - Efe Karasakal <hi@efe.dev>
PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Wed, 28 Oct 2026 22:09:59 GMT
   ✔  Approvals: 2
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/67094#pullrequestreview-5901952624
   ✔  - Tim Perry (@pimterry): https://github.com/nodejs/node/pull/67094#pullrequestreview-5937843708
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2026-11-17T17:25:38Z: https://ci.nodejs.org/job/node-test-pull-request/79220/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79220/
�[36m⠙�[39m Querying data for job/node-test-pull-request/79220/
�[36m⠙�[39m Querying API for job/node-test-pull-request/79220/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
�[36m⠹�[39m Bringing origin/main up to date...
�[36m⠹�[39m Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
�[36m⠸�[39m Downloading patch for 67094
�[36m⠸�[39m Downloading patch for 67094
From https://github.com/nodejs/node
 * branch                  refs/pull/67094/merge -> FETCH_HEAD
✔  Fetched commits as d2da05f14be5..a8c0f4282ca9
--------------------------------------------------------------------------------
Auto-merging lib/internal/quic/quic.js
Auto-merging src/quic/session.cc
[main c4ea0288fb] quic: handle application-specific no-error codes
 Author: Efe Karasakal <hi@efe.dev>
 Date: Wed Oct 28 23:05:42 2026 +0100
 15 files changed, 288 insertions(+), 129 deletions(-)
 create mode 100644 test/parallel/test-quic-session-application-no-error.mjs
Auto-merging src/quic/session.cc
[main 915c06fe82] quic: fmt
 Author: Efe Karasakal <hi@efe.dev>
 Date: Wed Oct 28 23:18:35 2026 +0100
 3 files changed, 3 insertions(+), 4 deletions(-)
Auto-merging lib/internal/quic/quic.js
[main 42b4ea44af] quic: revert incorrect adjustment and fix docs
 Author: Efe Karasakal <hi@efe.dev>
 Date: Fri Nov 13 17:54:05 2026 +0100
 4 files changed, 9 insertions(+), 10 deletions(-)
Auto-merging lib/internal/quic/quic.js
[main 3057700e61] quic: handle stop sending
 Author: Efe Karasakal <hi@efe.dev>
 Date: Fri Nov 13 19:35:50 2026 +0100
 5 files changed, 47 insertions(+), 5 deletions(-)
Auto-merging lib/internal/quic/quic.js
[main e9de580daa] quic: lint
 Author: Efe Karasakal <hi@efe.dev>
 Date: Fri Nov 13 20:55:58 2026 +0100
 1 file changed, 2 insertions(+), 2 deletions(-)
[main 2710dafd04] quic: fix no crypto build
 Author: Efe Karasakal <hi@efe.dev>
 Date: Mon Nov 16 20:59:17 2026 +0100
 1 file changed, 1 insertion(+), 1 deletion(-)
   ✔  Patches applied
There are 6 commits in the PR. Attempting autorebase.
(node:431) [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/12)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: handle application-specific no-error codes

Signed-off-by: Efe Karasakal <hi@efe.dev>
PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD d71c638bbd] quic: handle application-specific no-error codes
 Author: Efe Karasakal <hi@efe.dev>
 Date: Wed Oct 28 23:05:42 2026 +0100
 15 files changed, 288 insertions(+), 129 deletions(-)
 create mode 100644 test/parallel/test-quic-session-application-no-error.mjs
Rebasing (3/12)
Rebasing (4/12)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: fmt

Signed-off-by: Efe Karasakal <hi@efe.dev>
PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD abcf97a65e] quic: fmt
 Author: Efe Karasakal <hi@efe.dev>
 Date: Wed Oct 28 23:18:35 2026 +0100
 3 files changed, 3 insertions(+), 4 deletions(-)
Rebasing (5/12)
Rebasing (6/12)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: revert incorrect adjustment and fix docs

PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 441a5baa5a] quic: revert incorrect adjustment and fix docs
 Author: Efe Karasakal <hi@efe.dev>
 Date: Fri Nov 13 17:54:05 2026 +0100
 4 files changed, 9 insertions(+), 10 deletions(-)
Rebasing (7/12)
Rebasing (8/12)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: handle stop sending

PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 51095e5e7f] quic: handle stop sending
 Author: Efe Karasakal <hi@efe.dev>
 Date: Fri Nov 13 19:35:50 2026 +0100
 5 files changed, 47 insertions(+), 5 deletions(-)
Rebasing (9/12)
Rebasing (10/12)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: lint

PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD 68bfa521da] quic: lint
 Author: Efe Karasakal <hi@efe.dev>
 Date: Fri Nov 13 20:55:58 2026 +0100
 1 file changed, 2 insertions(+), 2 deletions(-)
Rebasing (11/12)
Rebasing (12/12)
Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
quic: fix no crypto build

PR-URL: https://github.com/nodejs/node/pull/67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
--------------------------------------------------------------------------------
[detached HEAD aaf618bb98] quic: fix no crypto build
 Author: Efe Karasakal <hi@efe.dev>
 Date: Mon Nov 16 20:59:17 2026 +0100
 1 file changed, 1 insertion(+), 1 deletion(-)
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.

View workflow run

@efekrskl efekrskl added commit-queue-squash PRs the Commit Queue should land as one squashed commit. commit-queue PRs queued for automated landing through the Commit Queue. and removed commit-queue-failed PRs whose Commit Queue landing failed and need manual intervention before retrying. labels Nov 17, 2026
@nodejs-github-bot
nodejs-github-bot merged commit 3e797cb into nodejs:main Nov 18, 2026
98 of 101 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 3e797cb

@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in QUIC Team Nov 18, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 18, 2026
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
Signed-off-by: Efe Karasakal <hi@efe.dev>
PR-URL: #67094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC transport implementation.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants