Skip to content

[Fix] Remove get folder parent util fxn, prevent text input in install modal path field #673

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

Merged
merged 7 commits into from
Dec 20, 2023

Conversation

BrettCleary
Copy link
Collaborator

@BrettCleary BrettCleary commented Dec 13, 2023

Summary

This closes #672

waiting for upstream PR merge here Alex-D/check-disk-space#29

Background

https://github.com/Alex-D/check-disk-space is used by both Heroic and HyperPlay to check available disk space. The getFirstExistingParentPath function was copied from this package into the utils file on this PR Heroic-Games-Launcher/HeroicGamesLauncher#1575. This function is now duplicated in 3 places, in the original package, in heroic utils, and in hyperplay utils.

There is a bug when checking disk space for Z: where Z is a non-existent drive on windows #672. The function gets caught in an infinite while loop and crashes HyperPlay. Because the InstallModal install path text field was editable, a user could type this out in the text field and (since disk space is calculated after every keystroke) this would crash HyperPlay.

This PR

  • Consolidates the function getFirstExistingParentPath back into the @hyperplay/check-disk-usage package until an upstream PR is accepted
  • Prevents text input in the install modal, forcing the user to use their respective file explorer which has better error handling
  • Fixes the previous infinite while loop bug and adds more testing to check-disk-usage

@BrettCleary BrettCleary self-assigned this Dec 13, 2023
@BrettCleary BrettCleary marked this pull request as ready for review December 14, 2023 21:19
@BrettCleary BrettCleary added PR: Ready-For-Review PR is ready to be reviewed by peers PR: Ready-For-Test PR is ready to be tested by a QA labels Dec 14, 2023
@BrettCleary BrettCleary removed PR: Ready-For-Review PR is ready to be reviewed by peers PR: Ready-For-Test PR is ready to be tested by a QA labels Dec 15, 2023
@BrettCleary BrettCleary merged commit 148de80 into main Dec 20, 2023
@BrettCleary BrettCleary deleted the fix/install_path_input branch December 20, 2023 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Entering path for non-existent drive crashes HyperPlay
4 participants