From a067366b5d40077790424900c72206efa7568e43 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Thu, 23 Nov 2023 11:42:53 +0800 Subject: [PATCH] fix(vscode): Hotfix 1.1.3. Do not show disconnected notification when initializing (#868) * fix(vscode): Do not show disconnected notification when initializing. * chore(vscode): vscode hotfix 1.1.3. --- clients/vscode/CHANGELOG.md | 8 +++++++- clients/vscode/package.json | 2 +- clients/vscode/src/TabbyStatusBarItem.ts | 9 +++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/clients/vscode/CHANGELOG.md b/clients/vscode/CHANGELOG.md index 6999055..d1c4aed 100644 --- a/clients/vscode/CHANGELOG.md +++ b/clients/vscode/CHANGELOG.md @@ -1,8 +1,14 @@ +## 1.1.3 + +### Fixes: + +- Fixed a bug that caused the disconnected notification to show up every time when VSCode is started. Now, the notification will only appear after the user modifies the server endpoint settings and the connection fails. + ## 1.1.2 ### Fixes: -- Fix a bug cause the completion does not show up if the completion cache is missing. +- Fixed a bug that caused the completion to not show up when the completion cache is missing. ## 1.1.0 diff --git a/clients/vscode/package.json b/clients/vscode/package.json index 030bea4..6a3ef82 100644 --- a/clients/vscode/package.json +++ b/clients/vscode/package.json @@ -7,7 +7,7 @@ "repository": "https://github.com/TabbyML/tabby", "bugs": "https://github.com/TabbyML/tabby/issues", "license": "Apache-2.0", - "version": "1.1.2", + "version": "1.1.3", "keywords": [ "ai", "autocomplete", diff --git a/clients/vscode/src/TabbyStatusBarItem.ts b/clients/vscode/src/TabbyStatusBarItem.ts index 28cfe03..97c04de 100644 --- a/clients/vscode/src/TabbyStatusBarItem.ts +++ b/clients/vscode/src/TabbyStatusBarItem.ts @@ -172,14 +172,19 @@ export class TabbyStatusBarItem { agent().on("issuesUpdated", (event: IssuesUpdatedEvent) => { console.debug("Tabby agent issuesUpdated", { event }); - this.fsmService.send(agent().getStatus()); + const status = agent().getStatus(); + this.fsmService.send(status); const showCompletionResponseWarnings = !this.completionResponseWarningShown && !this.extensionContext.globalState .get("notifications.muted", []) .includes("completionResponseTimeIssues"); if (event.issues.includes("connectionFailed")) { - notifications.showInformationWhenDisconnected(); + // Only show this notification when user modifies the settings, do not show it when initializing + // FIXME: refactor this use a flag marks the event is trigger by modifying settings or initializing + if (status !== "notInitialized") { + notifications.showInformationWhenDisconnected(); + } } else if (showCompletionResponseWarnings && event.issues.includes("highCompletionTimeoutRate")) { this.completionResponseWarningShown = true; notifications.showInformationWhenHighCompletionTimeoutRate();