-
-
Notifications
You must be signed in to change notification settings - Fork 435
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
[Refactor] Refactor abort controllers to simplify creation/deletion #3056
Conversation
@@ -826,6 +829,9 @@ async function callRunner( | |||
return currentPromise | |||
} | |||
|
|||
const abortId = options?.abortId || appName || Math.random().toString() |
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.
if no abortId is passed, it tries to get the appName from the command, else it generates a random id
createAbortController(release.version).signal | ||
) | ||
deleteAbortController(release.version) | ||
const result = await installWineVersion(release, onProgress) |
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.
since the abortId is release.version
, I'm just reading that inside installWineVersion
so no need of a parameter, but it's created the same way as before
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.
Codewise looks good. It is just a lot of places to test so it is more likely we find bugs after the next release with this change.
although looking at the code I think everything will be fine.
I'm merging this, I tested a lot of things and if we get this merged we can have more developers testing before a release I don't want to start getting conflicts |
We have this pattern in a lot of places:
This PR is a refactor of that to only need the abortId when calling the functions and the abort controllers are created/deleted internally. It removes a lot of imports and explicit calls to
createAbortController
anddeleteAbortController
.So now we don't need the imports and we can do
The abortId is also now optional, if we want to run something that we don't need to abort manually we can ignore that option.
We can still abort things when needed since the abort controllers are still being tracked and created with the same ID as before.
Use the following Checklist if you have changed something on the Backend or Frontend: