You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If more than one file is of type UV_DIRENT_UNKNOWN and fs.stat returns with an error for more than one of these files, the callback will be called more than once. That could lead to unexpected behavior for API users.
I don't know if that needs to be fixed as the scenario seems very unlikely, but I thought I should at least report it.
The text was updated successfully, but these errors were encountered:
This commit ensures that the readdir() callback can only be
called once when the withFileTypes parameter is supplied.
PR-URL: #22793Fixes: #22778
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
This commit ensures that the readdir() callback can only be
called once when the withFileTypes parameter is supplied.
PR-URL: #22793Fixes: #22778
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
This commit ensures that the readdir() callback can only be
called once when the withFileTypes parameter is supplied.
PR-URL: #22793Fixes: #22778
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
While looking through the code of
readDir
's new optionwithFileTypes
I noticed thatgetDirents
unconditionally calls the callback in case of an error:node/lib/internal/fs/utils.js
Lines 133 to 136 in d994e26
If more than one file is of type
UV_DIRENT_UNKNOWN
andfs.stat
returns with an error for more than one of these files, the callback will be called more than once. That could lead to unexpected behavior for API users.I don't know if that needs to be fixed as the scenario seems very unlikely, but I thought I should at least report it.
The text was updated successfully, but these errors were encountered: