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

Fix fs.walkStream to properly end async iterators #103

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

gpittarelli
Copy link
Contributor

What is the purpose of this pull request?

Attempting to use walkStream's returned stream.Readable as an async iterator leads to loops that never complete:

for await (const entry of walkStream(".")) {}
console.log("Never happens");

What changes did you make? (Give an overview)

Fixed StreamProvider's custom destroy() implementation to use the callback parameter which is required to correctly finish the stream.

Added a 'should support async iteration' test which demonstrates the issue on master, but works with this change.

@mrmlnc mrmlnc merged commit 7875cc1 into nodelib:master Jan 8, 2024
13 checks passed
@mrmlnc
Copy link
Contributor

mrmlnc commented Jan 8, 2024

Thank you for the contribution!

I apologize for the delay in reviewing and approving your pull request. I am planning to release a new version this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants