GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: reduce duplication through consolidation by jasnell · Pull Request #67497 · nodejs/node

Conversation

@jasnell

@jasnell jasnell commented Nov 15, 2026

Copy link
Copy Markdown
Member

Reduce code by consolidating cleanup. See individual commits

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jasnell added 4 commits November 15, 2026 19:28
@jasnell
dns: share reply parsing skeleton between record parsers
58bca61
The MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the
same structure: lazily create the record dictionary template, parse the
reply, iterate the answer section filtering by record type, build and
append each record, and report ENODATA when nothing matched. Factor
that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord()
helpers so each parser only contains its record-specific extraction.

Behavior is unchanged, including TLSA results being indexed by answer
position and never reporting ENODATA.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
@jasnell
src: share snapshot Serialize()/Deserialize() logic for binding data
b6fcc7f
Eleven snapshotable binding data classes implemented Deserialize() with
the same sequence of opening a handle scope, looking up the Realm, and
recreating the binding data on the holder, and six of them implemented
Serialize() by handing over the InternalFieldInfo allocated in
PrepareForSerialization(). Add Realm::DeserializeBindingData() and
TakeInternalFieldInfo() helpers and use them.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
@jasnell
fs: check permissions once in bindings with async and sync paths
6e1015f
Eleven fs bindings (stat, statfs, link, rename, unlink, realpath,
readdir, copyFile, chown, lchown, mkdtemp) repeated every permission
check in both the asynchronous and the synchronous branch, differing
only in whether the denial is reported through the request or thrown.
Obtain the request wrap up front with a new GetAsyncReqWrap() helper
and perform each check once with FS_THROW_IF_INSUFFICIENT_PERMISSIONS(),
which picks the reporting style based on whether the call is async.

How permission denials are reported is unchanged.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
@jasnell
fs: use GetAsyncReqWrap() in the remaining async/sync bindings
5f73d63
Replace the repeated `if (argc > N) { req = GetReqWrap(args, N);
CHECK_NOT_NULL(req); ...` prologue of the fs bindings that select the
asynchronous path by argument count with GetAsyncReqWrap().

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
@jasnell
jasnell requested review from RafaelGSS and mcollina November 15, 2026 19:30
@nodejs-github-bot

nodejs-github-bot commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net
  • @nodejs/realm
  • @nodejs/startup
  • @nodejs/url
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Nov 15, 2026
gurgunday
gurgunday approved these changes Nov 15, 2026
View reviewed changes

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

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.

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell jasnell 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 15, 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 15, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 15, 2026 •
edited by jasnell
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/79132/ 💚

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Nov 15, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.49407% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.70%. Comparing base (d105ef7) to head (5f73d63).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/cares_wrap.cc 67.42% 34 Missing and 9 partials ⚠️
src/node_file.cc 81.11% 0 Missing and 17 partials ⚠️
src/glob/node_glob.cc 0.00% 1 Missing ⚠️
src/node_realm-inl.h 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67497      +/-   ##
==========================================
+ Coverage   90.67%   90.70%   +0.03%     
==========================================
  Files         799      799              
  Lines      280245   280039     -206     
  Branches    54125    54028      -97     
==========================================
- Hits       254100   254014      -86     
+ Misses      16280    16215      -65     
+ Partials     9865     9810      -55     
Files with missing lines Coverage Δ
src/encoding_binding.cc 56.60% <100.00%> (-0.50%) ⬇️
src/node_blob.cc 73.40% <100.00%> (-0.09%) ⬇️
src/node_diagnostics_channel.cc 85.23% <100.00%> (+1.05%) ⬆️
src/node_modules.cc 79.75% <100.00%> (-0.16%) ⬇️
src/node_process_methods.cc 88.67% <100.00%> (-0.15%) ⬇️
src/node_realm.h 100.00% <ø> (ø)
src/node_snapshotable.cc 73.68% <100.00%> (-0.06%) ⬇️
src/node_snapshotable.h 100.00% <100.00%> (ø)
src/node_url.cc 78.93% <100.00%> (-0.52%) ⬇️
src/node_v8.cc 87.41% <100.00%> (+0.04%) ⬆️
... and 5 more

... and 34 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Nov 15, 2026
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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.

rslgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell jasnell added author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. labels Nov 15, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Landed in a625b01...2aa3762

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nodejs-github-bot pushed a commit that referenced this pull request Nov 17, 2026
@jasnell @nodejs-github-bot
dns: share reply parsing skeleton between record parsers
843a89c
The MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the
same structure: lazily create the record dictionary template, parse the
reply, iterate the answer section filtering by record type, build and
append each record, and report ENODATA when nothing matched. Factor
that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord()
helpers so each parser only contains its record-specific extraction.

Behavior is unchanged, including TLSA results being indexed by answer
position and never reporting ENODATA.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Nov 17, 2026
@jasnell @nodejs-github-bot
src: share snapshot Serialize()/Deserialize() logic for binding data
f04f249
Eleven snapshotable binding data classes implemented Deserialize() with
the same sequence of opening a handle scope, looking up the Realm, and
recreating the binding data on the holder, and six of them implemented
Serialize() by handing over the InternalFieldInfo allocated in
PrepareForSerialization(). Add Realm::DeserializeBindingData() and
TakeInternalFieldInfo() helpers and use them.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Nov 17, 2026
@jasnell @nodejs-github-bot
fs: check permissions once in bindings with async and sync paths
72d04a6
Eleven fs bindings (stat, statfs, link, rename, unlink, realpath,
readdir, copyFile, chown, lchown, mkdtemp) repeated every permission
check in both the asynchronous and the synchronous branch, differing
only in whether the denial is reported through the request or thrown.
Obtain the request wrap up front with a new GetAsyncReqWrap() helper
and perform each check once with FS_THROW_IF_INSUFFICIENT_PERMISSIONS(),
which picks the reporting style based on whether the call is async.

How permission denials are reported is unchanged.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Nov 17, 2026
@jasnell @nodejs-github-bot
fs: use GetAsyncReqWrap() in the remaining async/sync bindings
2aa3762
Replace the repeated `if (argc > N) { req = GetReqWrap(args, N);
CHECK_NOT_NULL(req); ...` prologue of the fs bindings that select the
asynchronous path by argument count with GetAsyncReqWrap().

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@nodejs-github-bot nodejs-github-bot closed this Nov 17, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 17, 2026
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
@jasnell @aduh95
dns: share reply parsing skeleton between record parsers
92a0cc4
The MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the
same structure: lazily create the record dictionary template, parse the
reply, iterate the answer section filtering by record type, build and
append each record, and report ENODATA when nothing matched. Factor
that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord()
helpers so each parser only contains its record-specific extraction.

Behavior is unchanged, including TLSA results being indexed by answer
position and never reporting ENODATA.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
@jasnell @aduh95
src: share snapshot Serialize()/Deserialize() logic for binding data
0258bef
Eleven snapshotable binding data classes implemented Deserialize() with
the same sequence of opening a handle scope, looking up the Realm, and
recreating the binding data on the holder, and six of them implemented
Serialize() by handing over the InternalFieldInfo allocated in
PrepareForSerialization(). Add Realm::DeserializeBindingData() and
TakeInternalFieldInfo() helpers and use them.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
@jasnell @aduh95
fs: check permissions once in bindings with async and sync paths
84b846a
Eleven fs bindings (stat, statfs, link, rename, unlink, realpath,
readdir, copyFile, chown, lchown, mkdtemp) repeated every permission
check in both the asynchronous and the synchronous branch, differing
only in whether the denial is reported through the request or thrown.
Obtain the request wrap up front with a new GetAsyncReqWrap() helper
and perform each check once with FS_THROW_IF_INSUFFICIENT_PERMISSIONS(),
which picks the reporting style based on whether the call is async.

How permission denials are reported is unchanged.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 19, 2026
@jasnell @aduh95
fs: use GetAsyncReqWrap() in the remaining async/sync bindings
081f642
Replace the repeated `if (argc > N) { req = GetReqWrap(args, N);
CHECK_NOT_NULL(req); ...` prologue of the fs bindings that select the
asynchronous path by argument count with GetAsyncReqWrap().

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: #67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
2026-11-25, Version 27.0.0-alpha.0.2.0 (Alpha) #67757
Merged
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@jasnell @gabylb
dns: share reply parsing skeleton between record parsers
19082d3
The MX, CAA, TLSA, TXT, SRV, and NAPTR reply parsers each repeated the
same structure: lazily create the record dictionary template, parse the
reply, iterate the answer section filtering by record type, build and
append each record, and report ENODATA when nothing matched. Factor
that into GetRecordTemplate(), ForEachAnswer(), and AppendRecord()
helpers so each parser only contains its record-specific extraction.

Behavior is unchanged, including TLSA results being indexed by answer
position and never reporting ENODATA.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: nodejs#67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@jasnell @gabylb
src: share snapshot Serialize()/Deserialize() logic for binding data
22f7f97
Eleven snapshotable binding data classes implemented Deserialize() with
the same sequence of opening a handle scope, looking up the Realm, and
recreating the binding data on the holder, and six of them implemented
Serialize() by handing over the InternalFieldInfo allocated in
PrepareForSerialization(). Add Realm::DeserializeBindingData() and
TakeInternalFieldInfo() helpers and use them.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: nodejs#67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@jasnell @gabylb
fs: check permissions once in bindings with async and sync paths
59fa97d
Eleven fs bindings (stat, statfs, link, rename, unlink, realpath,
readdir, copyFile, chown, lchown, mkdtemp) repeated every permission
check in both the asynchronous and the synchronous branch, differing
only in whether the denial is reported through the request or thrown.
Obtain the request wrap up front with a new GetAsyncReqWrap() helper
and perform each check once with FS_THROW_IF_INSUFFICIENT_PERMISSIONS(),
which picks the reporting style based on whether the call is async.

How permission denials are reported is unchanged.

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: nodejs#67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@jasnell @gabylb
fs: use GetAsyncReqWrap() in the remaining async/sync bindings
f9cd4e4
Replace the repeated `if (argc > N) { req = GetReqWrap(args, N);
CHECK_NOT_NULL(req); ...` prologue of the fs bindings that select the
asynchronous path by argument count with GetAsyncReqWrap().

Assisted-by: Claude
Signed-off-by: James M Snell <[email protected]>
PR-URL: nodejs#67497
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@gurgunday gurgunday gurgunday approved these changes
@RafaelGSS RafaelGSS Awaiting requested review from RafaelGSS

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@jasnell @nodejs-github-bot @mcollina @gurgunday
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.