-
Notifications
You must be signed in to change notification settings - Fork 36
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
[TECH] Improve Patching process to avoid file and directory removal errors #1246
base: main
Are you sure you want to change the base?
Conversation
…related async calls
Can we create a test plan for this? @flavioislima @nyghtstalker |
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. let's test it out 🚀
Could you bump the package.json version on this branch too?
I wrote a few QASE tests for the patching that should cover those. I will just update with the expected behavior of having all .temp files deleted. |
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.
- Confirmed the game patches as expected
- Confirmed the contents of the .temp folder are deleted when canceling
- Confirmed the contents of the .temp folder are deleted after update is complete
- https://app.qase.io/case/HC-571
This pull request introduces several changes to the
src/backend/storeManagers/hyperplay/games.ts
and related files to improve the handling of directory removal and ensure asynchronous operations are properly awaited. The most important changes include the addition of a new utility functionsafeRemoveDirectory
, modifications to existing functions to use this new utility, and updates to import statements.Key Changes:
Utility Enhancements:
safeRemoveDirectory
insrc/backend/storeManagers/hyperplay/utils.ts
to safely remove directories with retry logic and handle Windows EPERM issues. This function must always be awaited to prevent race conditions.Function Modifications:
cleanUpDownload
function insrc/backend/storeManagers/hyperplay/games.ts
to be asynchronous and usesafeRemoveDirectory
instead ofrmSync
.onCancel
function indownloadGame
to be asynchronous and awaitcleanUpDownload
.extract
function to awaitcleanUpDownload
in multiple places to ensure proper cleanup. [1] [2] [3]Directory Removal:
rmSync
withsafeRemoveDirectory
in theapplyPatching
function to handle directory removal asynchronously and with retry logic. [1] [2] [3] [4]Import Updates:
safeRemoveDirectory
and updated existing imports to includelogWarning
andrmSync
insrc/backend/storeManagers/hyperplay/utils.ts
.How to test
https://app.qase.io/project/HC?case=571&suite=39
Use the following Checklist if you have changed something on the Backend or Frontend: