Skip to content
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

fs.readdir(path, { recursive: true }) is sync #56006

Closed
RafaelGSS opened this issue Nov 26, 2024 · 3 comments · Fixed by #56041
Closed

fs.readdir(path, { recursive: true }) is sync #56006

RafaelGSS opened this issue Nov 26, 2024 · 3 comments · Fixed by #56041
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system.

Comments

@RafaelGSS
Copy link
Member

Reviving #51749.

The implementation in #41439 is calling a synchronous approach even for an asynchronous call. See https://github.com/nodejs/node/blob/main/lib/fs.js#L1458.

I will take a quick look at that and see if I can fix it; otherwise, we might want to consider documenting it explicitly until we have a real solution for it.

cc: @Ethan-Arrowood

@RafaelGSS RafaelGSS added confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system. labels Nov 26, 2024
@aduh95
Copy link
Contributor

aduh95 commented Nov 26, 2024

We could mark it as legacy and decide to not fix the issue, as long as the promise version is correctly async we can probably get away with the callback version being wrongly sync.

@RafaelGSS
Copy link
Member Author

RafaelGSS commented Nov 27, 2024

We could mark it as legacy and decide to not fix the issue, as long as the promise version is correctly async we can probably get away with the callback version being wrongly sync.

If a sync version has a feature and its callback equivalent call doesn't... looks like a bad UX to me. Have we considered a new function instead? It seems more appropriate: fs.recursiveReaddir()

@RafaelGSS
Copy link
Member Author

Nevermind, I have a PR almost ready to fix this.

RafaelGSS added a commit to RafaelGSS/node that referenced this issue Nov 27, 2024
@aduh95 aduh95 closed this as completed in 53356c3 Dec 5, 2024
targos pushed a commit that referenced this issue Dec 6, 2024
Fixes: #56006
PR-URL: #56041
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
aduh95 pushed a commit that referenced this issue Dec 13, 2024
Fixes: #56006
PR-URL: #56041
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
aduh95 pushed a commit that referenced this issue Dec 13, 2024
Fixes: #56006
PR-URL: #56041
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
aduh95 pushed a commit that referenced this issue Dec 13, 2024
Fixes: #56006
PR-URL: #56041
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
aduh95 pushed a commit that referenced this issue Dec 18, 2024
Fixes: #56006
PR-URL: #56041
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
ruyadorno pushed a commit that referenced this issue Jan 5, 2025
Fixes: #56006
PR-URL: #56041
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants