Skip to content

net: fix onread with shared buffers - #67710

Open
fatihguzeldev wants to merge 1 commit into
nodejs:mainfrom
fatihguzeldev:net-onread-shared-buffer
Open

fatihguzeldev wants to merge 1 commit into
nodejs:mainfrom
fatihguzeldev:net-onread-shared-buffer

Conversation

@fatihguzeldev

Copy link
Copy Markdown
Contributor

#67542 added a .detached check after the onread callback. the
getter throws when the buffer is backed by a SharedArrayBuffer.
this showed up in #67394's CI.

only call the getter on an ArrayBuffer. the new test checks that
a TCP socket can keep reading into shared buffers from the factory.

the detached getter throws on SharedArrayBuffer. check the backing
buffer type before calling it so onread can keep using shared buffers.

add a regression test that reads from a socket using shared buffers
returned by the onread buffer factory.

Refs: nodejs#67542
Refs: nodejs#67394
Signed-off-by: Fatih Güzel <fatihguzeldev@gmail.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Nov 22, 2026
@fatihguzeldev

Copy link
Copy Markdown
Contributor Author

hey @mcollina, my #67394 CI run hit this shared buffer case after #67542 landed. figured i'd send a small follow-up.

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.54%. Comparing base (97d5d90) to head (1a711b5).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67710      +/-   ##
==========================================
- Coverage   90.55%   90.54%   -0.01%     
==========================================
  Files         801      801              
  Lines      284111   284116       +5     
  Branches    54879    54876       -3     
==========================================
- Hits       257279   257265      -14     
- Misses      17006    17010       +4     
- Partials     9826     9841      +15     
Files with missing lines Coverage Δ
lib/internal/stream_base_commons.js 96.06% <100.00%> (+0.03%) ⬆️

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

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants