Skip to content

fs: fix for FileHandle.readableWebStream - #58842

Open
pdaehne wants to merge 1 commit into
nodejs:mainfrom
pdaehne:filehandle-readableWebStream-fix
Open

fs: fix for FileHandle.readableWebStream#58842
pdaehne wants to merge 1 commit into
nodejs:mainfrom
pdaehne:filehandle-readableWebStream-fix

Conversation

@pdaehne

@pdaehne pdaehne commented Jun 26, 2025

Copy link
Copy Markdown

Fixes FileHandle.readableWebStream in mode "byob" when reading into a view that has a byteOffset>0 into the underlying ArrayBuffer.

Fixes: #58817

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Jun 26, 2025
@Ethan-Arrowood Ethan-Arrowood added the request-ci Add this label to start a Jenkins CI on a PR. label Jun 26, 2025
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 26, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

LGTM, but I think we need to edit the return byteofset field in cpp to solve this problem, I wonder if I am thinking wrong here

@codecov

codecov Bot commented Jun 26, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (41525ab) to head (8303a83).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58842      +/-   ##
==========================================
- Coverage   90.16%   90.14%   -0.02%     
==========================================
  Files         746      746              
  Lines      242660   242660              
  Branches    45720    45722       +2     
==========================================
- Hits       218793   218756      -37     
- Misses      15360    15406      +46     
+ Partials     8507     8498       -9     
Files with missing lines Coverage Δ
lib/internal/fs/promises.js 93.00% <100.00%> (ø)

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

@pdaehne

pdaehne commented Jun 26, 2025

Copy link
Copy Markdown
Author

@mertcanaltin Have a look at this example in the Streams specification, it is more or less a copy of the code in Node.js, and they also use 0 as the "offset" parameter for "FileHandle.read()":

https://streams.spec.whatwg.org/#example-rbs-pull

@mertcanaltin

Copy link
Copy Markdown
Member

@mertcanaltin Have a look at this example in the Streams specification, it is more or less a copy of the code in Node.js, and they also use 0 as the "offset" parameter for "FileHandle.read()":

thanks!

@LiviaMedeiros LiviaMedeiros changed the title lib: fix for FileHandle.readableWebStream fs: fix for FileHandle.readableWebStream Jun 26, 2025

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

LGTM, thanks for fixing this!

The correct subsystem (prefix in the commit message) should be fs:, this also can be adjusted by a collaborator who lands it.

@LiviaMedeiros LiviaMedeiros added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 13, 2025
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 15, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Ethan-Arrowood Ethan-Arrowood added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 23, 2026
@github-actions github-actions Bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jul 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔  Jenkins credentials valid
- Querying data for job/node-test-pull-request/68095/
[SyntaxError: Unexpected token '<', ..."    
  https://github.com/nodejs/node/actions/runs/30049898777

@Ethan-Arrowood

Copy link
Copy Markdown
Contributor

This needs rebased on main if we want CI to start

@pdaehne
pdaehne force-pushed the filehandle-readableWebStream-fix branch from 0421c9e to 596b713 Compare July 28, 2026 15:34
@trivikr

trivikr commented Jul 28, 2026

Copy link
Copy Markdown
Member

@pdaehne Can you please sign the first commit and force push?

It's required as per updated instructions

Your commit must contain the Signed-off-by line with your name and email address as an acknowledgement that you agree to the Developer Certificate of Origin

Fixes FileHandle.readableWebStream in mode "byob" when reading into
a view that has a byteOffset>0 into the underlying ArrayBuffer.

Fixes: nodejs#58817
Signed-off-by: Patrick Dähne <pdaehne@gmail.com>
@pdaehne
pdaehne force-pushed the filehandle-readableWebStream-fix branch from 596b713 to 8303a83 Compare July 29, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in fileHandle.readableWebStream implementation

7 participants