-
-
Notifications
You must be signed in to change notification settings - Fork 17
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 endless loop when handling symlinks (#109) by @q0rban #109
Conversation
@q0rban I'm not sure that just removing code is the correct way to handle this. You should handle the case of infinite loop like keeping track of paths to be sure you don't hit the same path twice to break the loop |
The interesting thing is that the code is already keeping track of the paths. I couldn't figure out a scenario where this code wouldn't result in an infinite loop, which is why I deleted it. But then I realize it is assuming that the paths are not nested at the same level. So I believe the code will work if Furthermore, I don't believe this function will properly handle the scenario where there are multiple symlinks involved. For example, let's say module
but then, what happens if
This would result in
Does that mean this logic needs to recurse? The mind reels. |
Incidentally, do you have any tips on running tests locally? I don't see any documentation on that in the repo. |
@robertsLando updated the approach and would appreciate your thoughts. The existing logic seems error prone, and thus difficult to ascertain the intent of it. |
Also please fix lint issues: |
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.
Could you also add a test that covers this?
test-99-#108
Whoops, apologies, I missed this. Will take a look at what this entails. |
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.
See review above
Okay, test added. I can confirm that the test just hangs on the main branch, and builds properly on this branch. |
I know, I requested another review after pushing fixes based on that review. :) |
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.
Thanks for this! LGTM :)
Found improvements on how test works? 😆 Spent 2 days trying to improve them |
This resolves #108 for me. I tried to run tests locally to see if this breaks anything, but I guess the tests need to run in CI as they were failing with or without this change on my environment.
Fixes #108