-
-
Notifications
You must be signed in to change notification settings - Fork 449
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
[Ref/Fix] Improving checkDiskSpace #3440
Conversation
This is going to be used outside Legendary in the next commit
Doing this within Heroic allows us to use already-established patterns (dynamic import, helper functions like `genericSpawnWrapper`, validation using Zod)
This was a little overcomplicated, and lead to issues on Windows (where you don't necessarily have an existing root folder)
Just a follow-up for this one. Currently the One workaround I found in the past was to write a method that tries to write a test.txt file on the folder and returns true or false with the return. That should do it. the problem is that then we need to have two methods, but its fine. Or use only this test write file on all platforms, should work as well. |
- As Flavio mentioned, `access` doesn't seem to work on Windows, so I replaced that with some PowerShell commands that check the same thing - We have to call isWritable with the full path, as you can of course modify permissions on any folder, not just on a root directory/mount point Since this info is now always accurate, we might want to make the respective warning on the Frontend an error instead
93f5e80
to
49fc1bd
Compare
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.
lgtm
Our
checkDiskSpace
IPC function had a couple issues in edge-case scenarios, which could lead to Heroic freezing. Those are now resolvedTo reproduce the issue (in the current Heroic release)
It'd seem that an issue like this was also discovered on Linux by a user on our Discord (here). I can't reproduce this myself, but it might have the same root cause as the Windows issue
Use the following Checklist if you have changed something on the Backend or Frontend: