Skip to content

http2: avoid mutable push on private arrays - #67890

Open
rozzilla wants to merge 1 commit into
nodejs:mainfrom
rozzilla:http2-private-arrays-no-push
Open

rozzilla wants to merge 1 commit into
nodejs:mainfrom
rozzilla:http2-private-arrays-no-push

Conversation

@rozzilla

Copy link
Copy Markdown
Contributor

The pending request callbacks of a connecting client session and the single-value header names tracked by buildNgHeaderString() used .push() on private arrays. If user code replaced Array.prototype.push, these paths went through it. This uses indexed assignments instead. Same approach as #67748, #67751 and #67752: private arrays only.

The pending request callbacks of a connecting client session and the
single-value header names tracked by buildNgHeaderString() were
collected with .push() on private arrays, which looks up
Array.prototype.push at call time. Replacing that method from user
code changed how these paths ran. Use indexed assignments instead.

Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/http2
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run. labels Nov 30, 2026
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.59%. Comparing base (91f8170) to head (c6d81d9).
⚠️ Report is 55 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #67890   +/-   ##
=======================================
  Coverage   90.58%   90.59%           
=======================================
  Files         802      802           
  Lines      286659   286660    +1     
  Branches    55370    55367    -3     
=======================================
+ Hits       259676   259686   +10     
- Misses      17083    17084    +1     
+ Partials     9900     9890   -10     
Files with missing lines Coverage Δ
lib/internal/http2/core.js 95.12% <100.00%> (+<0.01%) ⬆️
lib/internal/http2/util.js 93.00% <100.00%> (ø)

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

@Ethan-Arrowood Ethan-Arrowood 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 30, 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 30, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

it'd be really nice to do these in one PR instead of dozens

@Ethan-Arrowood

Copy link
Copy Markdown
Contributor

I agree @ljharb but some have already merged so whatever at this point 🤷‍♂️

@Ethan-Arrowood Ethan-Arrowood 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 Dec 3, 2026
@rozzilla

rozzilla commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

it'd be really nice to do these in one PR instead of dozens

@ljharb same answer as here, let me know how you think it is better to proceed 😊

@github-actions github-actions Bot added request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. 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 Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Failed to start CI

   ℹ  Existing CI run found: https://ci.nodejs.org/job/node-test-pull-request/79617/
   ✖  Refusing to start a potentially duplicate CI job. CI has already succeeded for this commit.
Full Auto Start CI output
�[36m⠋�[39m Getting reviews from nodejs/node/pull/67890
�[36m⠋�[39m Getting commits from nodejs/node/pull/67890
�[36m⠙�[39m Validating Jenkins credentials
�[36m⠙�[39m Validating Jenkins credentials
✔  Jenkins credentials valid
�[36m⠹�[39m Getting comments from nodejs/node/pull/67890
�[36m⠸�[39m Querying data for job/node-test-pull-request/79617/
�[36m⠸�[39m Querying data for job/node-test-pull-request/79617/
�[36m⠸�[39m Querying API for job/node-test-pull-request/79617/
✔  Build data downloaded
   ℹ  Existing CI run found: https://ci.nodejs.org/job/node-test-pull-request/79617/
   ✖  Refusing to start a potentially duplicate CI job. CI has already succeeded for this commit.

View workflow run

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

Labels

http2 Issues and PRs related to the http2 subsystem. needs-ci PRs that need a full CI run. request-ci-failed Starting CI with the request-ci label failed and requires manual intervention.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants