Repository navigation
Conversation
ancestorDirectories only stopped when start string-matched stop, so any path-form drift (separator or case) walked past stop and dirname at the root kept returning the root - infinite recursion, RangeError, and the source marked unavailable, blocking instruction initialization for every session. Walk iteratively with an explicit root bound instead.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
3 of 6 tasks
Contributor
Author
|
The issue was closed as completed after #53349 landed — stopping the walk at case-variant Windows roots covers the same mismatch this PR was bounding at the filesystem root. Closing in favor of the upstream fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #50296
Type of change
What does this PR do?
ancestorDirectoriesinpackages/core/src/config/plugin/instruction.tsonly stops recursing whenstartstring-equalsstop. On Windows the two path forms drift in separator or case so the walk blows paststop. Sincedirname("C:\\")returns"C:\\"the recursion never bottoms out — it overflows the stack with aRangeError, the source-activation guard catches it, andcore/instructionsends up unavailable for every session drain.The walk is now iterative with an explicit filesystem-root bound, so it terminates at the root even when
stopis never string-reached.How did you verify your code works?
Added
test/config/instruction-ancestors.test.tswith a case wherestopis never an ancestor — the old recursive form overflows the stack on it, the new one returns the walk up to the root.bun test test/config test/instruction-state.test.ts test/instructions test/session-instructions.test.tsis 239 pass / 0 fail.bun typecheckclean.Screenshots / recordings
Not a UI change.
Checklist
Closes #50296