fix(core): treat symlink-to-directory as directory type#28531
Conversation
Symlinked directories (Linux ln -s) and Windows junction points were classified as 'symlink' because Node's isDirectory() returns false for reparse points. The downstream filter in file/index.ts skips entries with type !== 'directory', causing symlinked directories to be invisible in the directory picker and @file picker. Fix: check isDirectory() first for symlinks to determine if the target is a directory, returning 'directory' type instead of 'symlink'.
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #28529: fix(filesystem): resolve symlink/junction targets to directory type This PR appears to be addressing the exact same issue as PR #28531. Both PRs:
Recommendation: Check if PR #28529 is already merged or if one should be closed in favor of the other. |
|
Hey, thanks for taking a stab at this! Quick note — The fix in #28532 uses Want to close this in favor of #28532? It covers all platforms. |
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
Description
Symlinked directories (Linux
ln -s) and Windows junction points (e.g., OneDrive Desktop) were classified as'symlink'because Node'sisDirectory()returns false for reparse points. The downstream filter infile/index.tsskips entries withtype !== 'directory', causing symlinked directories to be invisible in the directory picker and @file picker.Root Cause
packages/core/src/filesystem.ts:74—readDirectoryEntriesclassifies symlinks and junction points as'symlink'becausee.isDirectory()returns false for reparse points. The check order was:isDirectory ? directory : isSymbolicLink ? symlink : isFile ? file : other.Fix
Check
isDirectory()for symlinks first to determine if the target is a directory:Fixes #28526
This PR was auto-generated as part of the GitHub Bounty Hunting workflow.