fix(core): resolve symlinks to directories in file listing - #39308
fix(core): resolve symlinks to directories in file listing#39308notsobad wants to merge 2 commits into
Conversation
FileSystem.Service.list filtered out all symlink entries, so symlinks to directories were invisible in the directory picker and other file browsing contexts. Resolve symlinks via stat (which follows the link) and include them with the appropriate file or directory type.
|
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. |
|
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. |
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate PRs found:
These PRs appear to address the exact same problem: symlinks not being properly resolved and displayed in file listing/directory picker functionality. Check their status and implementation details to avoid duplicate work. |
Issue for this PR
Closes #
Type of change
What does this PR do?
FileSystem.Service.listfiltered out all symlink entries, so symlinks to directories were invisible in the directory picker and other file browsing contexts.readDirectoryEntriesreturns"symlink"type for symlinks, but theflatMapinlistdiscarded anything that wasn't"file"or"directory".The fix resolves symlinks via
stat(which follows the link) and includes them with the resolved"file"or"directory"type. Broken symlinks are silently skipped viaEffect.option. No schema or handler changes needed since the output type remains"file" | "directory".How did you verified your code works?
I traced the code path:
readDirectoryEntriesclassifies symlinks as"symlink", which then gets filtered out inlist. The fix follows the same pattern asReadToolFileSystem.listwhich already resolves symlinks viastat. The code compiles correctly with the addedOptionimport.Screenshots / recordings
N/A
Checklist