[TECH] Improve Patching process to avoid file and directory removal errors #1258
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes multiple changes to the
hyperplay
package to enhance directory removal safety and improve patching event tracking. The key changes involve the introduction of a new utility function for safe directory removal, updates to the patching process to handle cleanup more robustly, and the addition of new patching event types.Improvements to directory removal:
src/backend/storeManagers/hyperplay/utils.ts
: Added thesafeRemoveDirectory
function to handle directory removal with retry logic and support for async removal based on directory size.Enhancements to patching process:
src/backend/storeManagers/hyperplay/games.ts
: Updated various functions (cleanUpDownload
,onCancel
,extract
,applyPatching
) to usesafeRemoveDirectory
instead ofrmSync
for directory cleanup. [1] [2] [3] [4] [5] [6] [7] [8] [9]Addition of new patching event types:
src/backend/metrics/types.ts
: AddedPatchingAborted
andPatchingCleanupFailed
interfaces to track new patching events and updated thePossibleMetricPayloads
type to include these new events. [1] [2]Minor version bump:
package.json
: Updated the package version from0.23.3
to0.24.0
.Other changes:
src/backend/storeManagers/hyperplay/games.ts
: AddedsafeRemoveDirectory
to the list of imported utilities.src/backend/utils.ts
: Updated thedownloadFile
function'sonCancel
parameter to return aPromise<void>
.src/backend/storeManagers/hyperplay/utils.ts
: AddedlogWarning
andcaptureException
imports for enhanced logging and error tracking.Use the following Checklist if you have changed something on the Backend or Frontend: