-
Notifications
You must be signed in to change notification settings - Fork 200
CodeQL model editor: user should be able to stop modeling before the main editor view is open #3189
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6a65094
Make preparation progress bar cancellable
norascheuch 0b27912
Make model editor open progress bar cancellable
norascheuch ad8dc1e
Update Changelog
norascheuch eb59ead
Catch request cancelled error
norascheuch 745544c
Use error type and error code
norascheuch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
I think the error + telemetry event is coming from here (since we catch the
UserCancellationException
and treat it like a normal error). Maybe we can check for the type of error here?Something like:
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.
I agree that this is where the log message is coming from, so we have the power to silence it. Annoyingly, the error isn't actually a
UserCancellationException
:shakes_fist:. As far as I can tell the error is coming from a rpc library and not our code. We may need to add a custom check for this type of error, like if the message matchesThe request \(.*\) has been cancelled
.Adding in
this.panel?.dispose()
is also good because otherwise the panel lingers open in the "loading" state and you need to close it manually.So maybe something like
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.
This looks really good! Yes, the catch is catching this error, I was just not sure if there are other instances where we might get a
The request \(.*\) has been cancelled
that was not due to a user cancellation...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.
Is it not? 😅 That
if
snippet worked when I tested locally (though maybe I didn't test all cases 🤔)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 if works, but it could be imaginable that something went wrong internally when running the query and an error message with the same text is produced, but we now swallow it.
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.
It didn't work for me 🤔 . I also tried adding a breakpoint there so I could poke at the error manually. I'm very happy to try again if you disagree.
Maybe but I'd expect the message wouldn't say "cancelled" then. How about we still log it but not show the popup? Keeping telemetry could be nice so we know how many people are cancelling this. We could do something like
vscode-codeql/extensions/ql-vscode/src/databases/github-databases/github-databases-module.ts
Lines 66 to 71 in d0e8112
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.
Sorry, I meant that my original suggestion of
if (err instanceof UserCancellationException)
worked fine for me! I was wondering what Robert meant by saying the error wasn't aUserCancellationException
🤔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.
ah! It depends on when you press the cancel button! There are two progress windows and for the first everything works, for the second it doesn't. So after the dependencies are installed and the query is actually run, we need the text match.
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.
Something which might be less hacky is the following, which checks the type of the other error and that it is a cancellation error: