Skip to content
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

Fix 'Device not ready' error #29

Merged
merged 1 commit into from May 26, 2021

Conversation

btglr
Copy link
Contributor

@btglr btglr commented May 25, 2021

Filters out any drive that has an empty fsType on Windows.
Additionally, sets the available, free and total size to 0 if diskusage.check raises an error.

Feel free to change whatever needs to be changed if you want to handle it any other way.

Fixes #1
Fixes #2
Fixes #10
Fixes #12
Fixes #13

Filters out any drive that has an empty fsType on Windows.
Additionally, sets the available, free and total size to 0 if
diskusage.check raises an error
@aleksey-hoffman
Copy link
Owner

Thank you for the PR. Have you tested it locally? Is it actually fixing those problems?

@aleksey-hoffman
Copy link
Owner

Also, can you please add these into PR description:

Fixes #2
Fixes #10
Fixes #12
Fixes #13

@btglr
Copy link
Contributor Author

btglr commented May 25, 2021

Thank you for the PR. Have you tested it locally? Is it actually fixing those problems?

Yes, I've tested it and it fixes the problem and allows the drives to load. I don't have a CD/DVD drive though so it'd be nice if someone could try out the PR.

Nevertheless there's probably a more elegant way to handle the problem. For example, do you intend to display RAW drives the same way the Windows Explorer does it? What about CD/DVD drives?

Right now I'm simply filtering those out which means they're not displayed at all.

@aleksey-hoffman
Copy link
Owner

For example, do you intend to display RAW drives the same way the Windows Explorer does it? What about CD/DVD drives?

Perhaps there are some other NPM modules I could use that can not only detect regular drives but also things like CD/DVD.
Or maybe I should just get the drive list using powershell commands. But I feel like it would take 100+ ms per call, which would be too slow, considering the drive data is updating once every second.

@aleksey-hoffman aleksey-hoffman added the help wanted Extra attention is needed label May 25, 2021
@aleksey-hoffman
Copy link
Owner

Merging it for now since the issue is affecting a lot of people.
Will add support for CD/DVD and raw drives later.

Thank you very much for the fix!

@aleksey-hoffman aleksey-hoffman merged commit be89b4c into aleksey-hoffman:main May 26, 2021
@btglr
Copy link
Contributor Author

btglr commented May 26, 2021

Perhaps there are some other NPM modules I could use that can not only detect regular drives but also things like CD/DVD.

The CD/DVD drives are correctly detected, the problem comes from diskusage attempting to check the free/available/total size for those drives as if they were hard drives. Anyway, I booted up a Windows 10 VM with a DVD drive and the fix works as it filters it out.

@aleksey-hoffman
Copy link
Owner

aleksey-hoffman commented May 26, 2021

@btglr thanks mate. I understand it now. Didn't really sleep for 2 days, so I was a little slow yesterday.

I agree that a more elegant way of handling this would have to be added later.
Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first PR help wanted Extra attention is needed
Projects
None yet
2 participants