diff --git a/package.json b/package.json index 5e1849233f..ccdf7e1227 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Cline", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.", - "version": "3.16.1", + "version": "3.16.2", "icon": "assets/icons/icon.png", "engines": { "vscode": "^1.84.0" diff --git a/src/extension.ts b/src/extension.ts index b4a69af9bf..efe4a2060c 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -53,21 +53,26 @@ export async function activate(context: vscode.ExtensionContext) { ) // Perform post-update actions if necessary - if (!previousVersion || currentVersion !== previousVersion) { - Logger.log(`Cline version changed: ${previousVersion} -> ${currentVersion}. First run or update detected.`) - const lastShownPopupNotificationVersion = context.globalState.get("clineLastPopupNotificationVersion") + try { + if (!previousVersion || currentVersion !== previousVersion) { + Logger.log(`Cline version changed: ${previousVersion} -> ${currentVersion}. First run or update detected.`) + const lastShownPopupNotificationVersion = context.globalState.get("clineLastPopupNotificationVersion") - if (currentVersion !== lastShownPopupNotificationVersion && previousVersion) { - // Show VS Code popup notification as this version hasn't been notified yet without doing it for fresh installs - const message = `Cline has been updated to v${currentVersion}` - await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus") - await new Promise((resolve) => setTimeout(resolve, 200)) - vscode.window.showInformationMessage(message) - // Record that we've shown the popup for this version. - await context.globalState.update("clineLastPopupNotificationVersion", currentVersion) + if (currentVersion !== lastShownPopupNotificationVersion && previousVersion) { + // Show VS Code popup notification as this version hasn't been notified yet without doing it for fresh installs + const message = `Cline has been updated to v${currentVersion}` + await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus") + await new Promise((resolve) => setTimeout(resolve, 200)) + vscode.window.showInformationMessage(message) + // Record that we've shown the popup for this version. + await context.globalState.update("clineLastPopupNotificationVersion", currentVersion) + } + // Always update the main version tracker for the next launch. + await context.globalState.update("clineVersion", currentVersion) } - // Always update the main version tracker for the next launch. - await context.globalState.update("clineVersion", currentVersion) + } catch (error) { + const errorMessage = error instanceof Error ? error.message : String(error) + console.error(`Error during post-update actions: ${errorMessage}, Stack trace: ${error.stack}`) } context.subscriptions.push(