Mark progress bars as cancellable where it appears we are respecting the token#3517
Mark progress bars as cancellable where it appears we are respecting the token#3517robertbrignull merged 6 commits intomainfrom
Conversation
charisk
left a comment
There was a problem hiding this comment.
Code changes LGTM.
Is it worth testing each of these actions to make sure they are truly cancellable (that the token passed is actually used appropriately)? Otherwise we could be giving people a cancel button that is broken.
koesie10
left a comment
There was a problem hiding this comment.
I'm not sure most of these should be cancellable. It would probably be better to remove the token instead.
|
Thanks for looking deeper into what the cancellation token actually does in these commands. I was originally hoping that because we pass it to the query server that it'll be used accordingly. I've now also dug into the code for the query server and I agree those three cases aren't actually as cancellable as they appear. Since we expect restarting the query server and trimming the cache to be pretty fast I agree we don't need to make them cancellable. It also isn't any change in behaviour from before this PR and is just cleaning up the code so it should be safe. |
|
I've updated the PR to only make the model editor one cancellable and for the query server ones leave them as not cancellable and clean up the code instead. I decided to remove the I've also quickly tested each of these cases manually just to make sure they work still. |
This PR should fix all instances of https://github.com/github/vscode-codeql/security/code-scanning?query=is%3Aopen+branch%3Amain+rule%3Avscode-codeql%2Fprogress-not-cancellable
These are cases where the progress bar is not marked as cancellable, but we are using the token as if it were cancellable. Theoretically everything should just work if we say the progress bar is cancellable, and this gives the user more power to cancel long-running operations.
Checklist
ready-for-doc-reviewlabel there.