Repository navigation
Fix Cancel button stuck visible after job manager refresh - #600
Merged
buzzia2001 merged 1 commit intoNov 25, 2026
Merged
Conversation
…resh updateStatusBar sends queries on the selected job (current schema, pending transactions, library list) without being awaited. SQLJob.send() marks the job as busy synchronously, so refresh() read a busy status and showed the Cancel button, which was never hidden once the queries completed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When a workspace is opened with
.sqlfiles already open, the SQL editor title bar can show the Cancel button (vscode-db2i.statement.cancel) even though nothing is running. While it is showing, the Run button is hidden and "Check SQL syntax" is disabled, because thevscode-db2i:statementCanCancelcontext key staystrue. Running any statement clears it, because the button is turned off when the statement finishes.Cause
JobManagerView.refresh()callsupdateStatusBar()without awaiting it. To build the tooltip,updateStatusBar()immediately sends queries on the selected job: the current schema, and pending transactions when the job is under commit control. In mapepire-js,SQLJob.send()sets the job status tobusysynchronously. So whenrefresh()then callsgetStatus(), it gets"busy"and shows the Cancel button. When the queries finish, the job goes back toready, but nothing recalculates the context key.On
mainthis happens with SQL naming (the first time only, because the current schema is cached after that) or when commit control is on. With #585, the status bar also fetches the library list or current path, and it callsgetCurrentSchemaon every new job, so the button gets stuck on every startup with either naming.Fix
Read the job status and set the Cancel button visibility before calling
updateStatusBar(), so the queries the status bar sends no longer affect it.Testing
.sqlfiles already open, connect, and check that the Run button shows and the Cancel button doesn't