-
Notifications
You must be signed in to change notification settings - Fork 2.6k
refactor(storage): better fs check #7164
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
Conversation
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.
Thank you for your contribution! I've reviewed the changes and have some suggestions for improvement. Overall, this is a good improvement that addresses issue #3788 - the change from creating/deleting a test file to using fs.access is more reliable and cleaner.
daniel-lxs
left a comment
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.
Thank you @elianiva! This looks good!
Related GitHub Issue
Closes: #3788
Closes: #7173
Roo Code Task Context (Optional)
Description
Currently we're checking if directory is writable by writing a file there and removing it, this could provide false-negative result. This PR changes it to use
fs.accessinstead so it is more consistent between runs.Test Procedure
Tried to run some sessions with the new changes and it seems to be fixed. I also added a new test, though it currently only checks on mocked fs if
fs.accesscall fails and whether or not it should default path / show warning instead of checking with the actual filesystem, not exactly sure what to do here.Pre-Submission Checklist
Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch
@elianiva
Important
Refactor directory writability check in
storage.tsusingfs.accessand add tests instorage.spec.ts.getStorageBasePathinstorage.tsto usefs.accessfor checking directory writability instead of creating and deleting a test file.promptForCustomStoragePathinstorage.tsto usefs.accessfor path validation.storage.spec.tsto verify behavior when custom path is writable and when it is not.fs/promisesto simulate different filesystem scenarios.This description was created by
for ba92646. You can customize this summary. It will automatically update as commits are pushed.