-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: fix fs.readdir recursive async #56041
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #56041 +/- ##
==========================================
- Coverage 88.00% 87.92% -0.09%
==========================================
Files 653 656 +3
Lines 188093 189063 +970
Branches 35942 35983 +41
==========================================
+ Hits 165537 166235 +698
- Misses 15734 15987 +253
- Partials 6822 6841 +19
|
} | ||
} | ||
|
||
function handleDirents({ result, currentPath, context }) { |
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.
Would you mind adding jsdoc to all newly/updated functions?
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.
I haven't added jsdoc to these ones because they are not public, they are used inside readdirRecursive
(which has JSDoc). It seems a pattern on this file.
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.
Line 1533 in 982a50e
options = getOptions(options); |
If
options
gets mutated (for example, to be reused subsequent readdir
) after the function call during the directory processing, the results might become unpredictable. We should copyObject()
it.
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
CI is failing
|
Thanks @aduh95. I forgot the readdir tests runs on |
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.
sgtm
Fixes: #56006
cc: @aduh95 @Ethan-Arrowood