Skip to content

Conversation

@y-okt
Copy link
Contributor

@y-okt y-okt commented Dec 2, 2025

Fixes: #58892

Calling readdir with a Buffer argument and the recursive flag produces an ERR_INVALID_ARG_TYPE error. The expected behavior would be for the readdir functions not to error and return either an array of Buffers or Dirents (depending on options.withFileTypes)

calling readdir with a buffer arguemnt and the recursive flag
produces an ERR_INVALID_ARG_TYPE error. This is to fix that.

Fixes: nodejs#58892
@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 Dec 2, 2025
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 96.61017% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.51%. Comparing base (6432765) to head (373b9a5).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/fs/promises.js 93.10% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #60936   +/-   ##
=======================================
  Coverage   88.51%   88.51%           
=======================================
  Files         703      703           
  Lines      208396   208446   +50     
  Branches    40201    40208    +7     
=======================================
+ Hits       184460   184513   +53     
- Misses      15939    15940    +1     
+ Partials     7997     7993    -4     
Files with missing lines Coverage Δ
lib/fs.js 98.20% <100.00%> (+0.01%) ⬆️
lib/internal/fs/promises.js 98.03% <93.10%> (-0.12%) ⬇️

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

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

all versions of readdir don't work in recursive mode when used with a buffer argument

2 participants