-
Notifications
You must be signed in to change notification settings - Fork 500
Reset flaggedForDeletion property after query editor close & reopen #19407
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
base: main
Are you sure you want to change the base?
Conversation
PR Changes
|
@@ -91,6 +93,13 @@ export default class QueryRunner { | |||
this._vscodeWrapper = new VscodeWrapper(); | |||
} | |||
|
|||
// Setup Logger | |||
|
|||
let channel = this._vscodeWrapper.createOutputChannel( |
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.
do we need a separate logging channel? I'm wonder if it's best practice to create new output channels per feature area?
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 was just following the convention used elsewhere in the extension, should we consolidate all the logs into one channel?
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.
We should be using vscodeWrapper.outputChannel, which will reuse the existing MSSQL one. Also, ideally adding a logging prefix to make logs easier to filter through: Logger.create(channel, "Querys")
or maybe "QueryRunner"
Currently, when we close a query editor, the associated query runner gets flagged for deletion, with a timer of 30 minutes. This flag does not get reset if we re-open the same query editor and run a query, which can lead to deletion of the query runner in the middle of a long-running query (due to the 30 minute timer) and can put the query editor in a bad state.
I have added a conditional which will reset the
flaggedForDeletion
property if we are re-using an existing query runner. I also added some additional logging to help with debugging in the future.Fixes #18837