From deb4de03be5ddad13b88a8c9ec29508731d98137 Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Wed, 8 Jul 2020 17:35:31 +0200 Subject: [PATCH] Fix bug where starting vscode with a ssh:// workfolder spams a ton of SFTP connections (and erroring out due to that) --- src/manager.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/manager.ts b/src/manager.ts index 8a751c6..e2a7123 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -162,12 +162,13 @@ export class Manager implements vscode.TreeDataProvider(async (resolve, reject) => { config = config || (await getConfigs()).find(c => c.name === name); if (!config) throw new Error(`Couldn't find a configuration with the name '${name}'`); - const con = await this.createConnection(name, config); + con = await this.createConnection(name, config); con.pendingUserCount++; config = con.actualConfig; - promise = catchingPromise(async (resolve, reject) => { const { getSFTP } = await import('./connect'); const { SSHFileSystem } = await import('./sshFileSystem'); // Query/calculate the root directory @@ -210,7 +211,7 @@ export class Manager implements vscode.TreeDataProvider { - con.pendingUserCount--; // I highly doubt resolve(fs) will error + if (con) con.pendingUserCount--; // I highly doubt resolve(fs) will error this.onDidChangeTreeDataEmitter.fire(null); if (!e) { delete this.creatingFileSystems[name];