Skip to content

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

Open
efekrskl wants to merge 2 commits into
nodejs:mainfrom
efekrskl:quic/error-mismatch
Open

efekrskl wants to merge 2 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
Signed-off-by: Efe Karasakal <[email protected]>
@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.65%. Comparing base (a066ccf) to head (ed96fea).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #67094   +/-   ##
=======================================
  Coverage   90.64%   90.65%           
=======================================
  Files         797      797           
  Lines      278797   278767   -30     
  Branches    53627    53622    -5     
=======================================
- Hits       252717   252708    -9     
+ Misses      16413    16402   -11     
+ Partials     9667     9657   -10     
Files with missing lines Coverage Δ
lib/internal/quic/quic.js 100.00% <100.00%> (ø)
lib/internal/quic/state.js 100.00% <100.00%> (ø)

... and 25 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.

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++. needs-ci PRs that need a full CI run. quic Issues and PRs related to the QUIC transport implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants