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: Avoid pushing additional paths to queue when error occurs #124

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

phated
Copy link
Member

@phated phated commented Mar 25, 2024

As mentioned at #122 (comment), @joshhunt pointed out that additional paths would be pushed to the queue if a symlink error occurred.

Here, I've pulled in our now-and-later dependency to iterate over the dirents with an iterator that handle async operations. This allows us to avoid pushing more items into the queue if an error occurs in the symlink resolution.

I couldn't find a good way to write a unit test for this because we don't expose the walker and the stream won't emit more data events after it has been destroyed. However, I did verify the behavior using console.log statements and adding a file named z-test.txt to the symlink directory.

@phated phated requested a review from sttk March 25, 2024 00:09
@phated phated merged commit 8eaab85 into master Mar 25, 2024
15 checks passed
@phated phated deleted the phated/process-dirents-async branch March 25, 2024 00:28
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.

1 participant