[Bug] File tools reject an absolute path that is inside the project through a symlink
Description
isValidFilePath checks absolute paths with isPathInside, which only compares the path strings. resolveFilePath calls that check before it looks at the real path, so the symlink check later in the function never runs.
Steps to Reproduce
- Open a project through a symlink. On macOS this also shows up for
/tmpvs/private/tmp. - Ask a file tool for the same file using the other spelling of the path.
Expected Behavior
The tool accepts the path. It is the same directory.
Actual Behavior
resolveFilePath throws Invalid file path. Both directions fail: symlink root with the real path, and real root with the symlink path.
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
@akramcodez Can i go for it ?
@addyCooks can i take this too? the string-compare-before-realpath ordering in isValidFilePath looks straightforward to fix, and i can reproduce the symlink case on macos.
@addyCooks thanks for the link. i saw someone already has a fix ready above so i'll step back. still keen on #1636/#1637 if either's free....