-
Notifications
You must be signed in to change notification settings - Fork 845
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: allow ctrl+c in provider install #1219
Conversation
Signed-off-by: bryans-go <[email protected]>
@quest-bot loot #1044 |
Quest PR submitted!@bryans-go, you are attempting to solve the issue and loot this Quest. Will you be successful? Questions? Check out the docs. |
@bryans-go you're right. This means that this PR is not ready for review? Please don't mark it as such until it is. Are you wiling to solve this issue for the spinner in general so it's fixed in all the places where we use it? If so, we'll double the bounty amount through a tip. |
@Tpuljak OK |
done! |
demo9.webm |
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.
Screen.Recording.2024-10-11.at.14.39.26.mov
While this does solve allowing ctrl+c out of the spinner, it does not tackle the problem at hand which is aborting the provider installation. As you can see from my screen recording, the installation continues and completes even though I cancelled the request.
Please address that. Moving the PR to draft until you do so. Thanks.
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.
The solution is very over-engineered 😅
I suggest you revert everything and go back to square one.
The easiest solution to this is to look at the DownloadFile function. I suggest that the functions takes in a context (that will be passed from the request). If that context is done before the download completes, it means that the user has aborted the request and that the download should stop and be cleaned up.
I'm pretty sure this is the only change (+ the spinner thing) that the PR will require.
Moving it back to draft.
@Tpuljak I also tried to implement the same thing that you said In your comment but once the request(POST in this case) is done by the user then how will the context get updated. |
All requests (in gin) have their own context on the request. I believe (I'm 99% sure) that that context is |
71423df
to
2ab3cd8
Compare
Signed-off-by: bryans-go <[email protected]>
2ab3cd8
to
165cfaa
Compare
Done ! |
demo-2024-10-14_20.15.46.mov |
Signed-off-by: bryans-go <[email protected]>
hey I think you forgot about the bounty part. |
tip ? |
fix: allow ctrl+c in provider install
Description
Related Issue(s)
Closes #1044
Screenshots
If relevant, please add screenshots.
Notes
Please add any relevant notes if necessary.