From 0be5f67621528e174bb31c5e60f60c218ed567e1 Mon Sep 17 00:00:00 2001 From: Lucy Zhang Date: Tue, 15 Sep 2020 11:31:31 -0700 Subject: [PATCH] Fix notebook cancel query bug (#12300) * fix undefined query runner error * store connection id * revert sqlSessionManager change --- .../services/notebook/browser/models/clientSession.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sql/workbench/services/notebook/browser/models/clientSession.ts b/src/sql/workbench/services/notebook/browser/models/clientSession.ts index 80679563a3..f5ca462cea 100644 --- a/src/sql/workbench/services/notebook/browser/models/clientSession.ts +++ b/src/sql/workbench/services/notebook/browser/models/clientSession.ts @@ -48,6 +48,7 @@ export class ClientSession implements IClientSession { private isServerStarted: boolean; private notebookManager: INotebookManager; private _kernelConfigActions: ((kernelName: string) => Promise)[] = []; + private _connectionId: string = ''; constructor(private options: IClientSessionOptions) { this._notebookUri = options.notebookUri; @@ -288,8 +289,9 @@ export class ClientSession implements IClientSession { // TODO is there any case where skipping causes errors? So far it seems like it gets called twice return; } - if (connection.id !== '-1') { + if (connection.id !== '-1' && connection.id !== this._connectionId) { await this._session.configureConnection(connection); + this._connectionId = connection.id; } }