Skip to content

Commit c584d06

Browse files
FrankLiu4138claude
andcommitted
fix(upgrade): remove waitForCommand, rely on existing error handling
Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
1 parent fda2956 commit c584d06

2 files changed

Lines changed: 1 addition & 17 deletions

File tree

src/upgrade/upgradeManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Settings } from "../settings";
1313
import assessmentManager, { getDirectDependencies } from "./assessmentManager";
1414
import { checkOrInstallAppModExtensionForUpgrade, checkOrPopupToInstallAppModExtensionForModernization } from "./utility";
1515

16-
const DEFAULT_UPGRADE_PROMPT = "Upgrade Java project dependency to latest version.";
16+
const DEFAULT_UPGRADE_PROMPT = "Upgrade Java runtime and frameworks to the latest stable version.";
1717

1818

1919
function shouldRunCheckup() {

src/upgrade/utility.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { commands, extensions, Uri, window } from "vscode";
55
import * as semver from "semver";
66
import { UpgradeReason, type UpgradeIssue } from "./type";
77
import { ExtensionName, Upgrade } from "../constants";
8-
import { Commands } from "../commands";
98
import { instrumentOperation, sendInfo } from "vscode-extension-telemetry-wrapper";
109
import { CveUpgradeIssue } from "./cve";
1110

@@ -173,19 +172,4 @@ export async function checkOrInstallAppModExtensionForUpgrade(
173172

174173
await commands.executeCommand("workbench.extensions.installExtension", ExtensionName.APP_MODERNIZATION_FOR_JAVA);
175174
await checkOrPromptToEnableAppModExtension("upgrade");
176-
177-
// Verify gotoAgentMode command is available after install/update
178-
await waitForCommand(Commands.GOTO_AGENT_MODE);
179-
}
180-
181-
async function waitForCommand(commandId: string, timeoutMs: number = 10000): Promise<void> {
182-
const startTime = Date.now();
183-
while (Date.now() - startTime < timeoutMs) {
184-
const allCommands = await commands.getCommands(true);
185-
if (allCommands.includes(commandId)) {
186-
return;
187-
}
188-
await new Promise(resolve => setTimeout(resolve, 500));
189-
}
190-
throw new Error(`Command '${commandId}' not available after extension install/update. Please reload VS Code and try again.`);
191175
}

0 commit comments

Comments
 (0)