Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/commands/durableTaskScheduler/createScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class SchedulerNamingStep extends AzureWizardPromptStep<ICreateSchedulerContext>
wizardContext.schedulerName = await wizardContext.ui.showInputBox({
prompt: localize('schedulerNamingStepPrompt', 'Enter a name for the new scheduler')
});
wizardContext.relatedNameTask = Promise.resolve(wizardContext.schedulerName);
}

shouldPrompt(wizardContext: ICreateSchedulerContext): boolean {
Expand Down
3 changes: 2 additions & 1 deletion src/commands/durableTaskScheduler/deleteScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import {type IActionContext } from "@microsoft/vscode-azext-utils";
import { type DurableTaskSchedulerClient } from "../../tree/durableTaskScheduler/DurableTaskSchedulerClient";
import { localize } from "../../localize";
import { type MessageItem } from "vscode";
import { commands, type MessageItem } from "vscode";
import { type DurableTaskSchedulerResourceModel } from "../../tree/durableTaskScheduler/DurableTaskSchedulerResourceModel";
import { type DurableTaskSchedulerDataBranchProvider } from "../../tree/durableTaskScheduler/DurableTaskSchedulerDataBranchProvider";
import { withCancellation } from "../../utils/cancellation";
Expand Down Expand Up @@ -55,6 +55,7 @@ export function deleteSchedulerCommandFactory(
}
finally {
dataBranchProvider.refresh();
await commands.executeCommand('azureResourceGroups.refresh');
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commands.executeCommand('azureResourceGroups.refresh') is awaited inside a finally block without error handling. If that command fails/rejects, it can mask the original delete error (or surface an error after a successful deletion). Consider wrapping the refresh call in its own try/catch (or void ...catch(...)) so the delete flow's outcome isn't overridden by a refresh failure.

Suggested change
await commands.executeCommand('azureResourceGroups.refresh');
try {
await commands.executeCommand('azureResourceGroups.refresh');
} catch {
// Ignore refresh failures so they do not override the delete result.
}

Copilot uses AI. Check for mistakes.
}
};
}
3 changes: 2 additions & 1 deletion src/commands/durableTaskScheduler/deleteTaskHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {type IActionContext } from "@microsoft/vscode-azext-utils";
import { type DurableTaskSchedulerClient } from "../../tree/durableTaskScheduler/DurableTaskSchedulerClient";
import { localize } from "../../localize";
import { type DurableTaskHubResourceModel } from "../../tree/durableTaskScheduler/DurableTaskHubResourceModel";
import { type MessageItem } from "vscode";
import { commands, type MessageItem } from "vscode";
import { withAzureActivity } from "../../utils/AzureActivity";
import { withCancellation } from "../../utils/cancellation";

Expand Down Expand Up @@ -52,6 +52,7 @@ export function deleteTaskHubCommandFactory(schedulerClient: DurableTaskSchedule
}
finally {
taskHub.scheduler.refresh();
await commands.executeCommand('azureResourceGroups.refresh');
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commands.executeCommand('azureResourceGroups.refresh') is awaited in a finally block with no error handling. A rejected refresh command can cause this command to throw even after the task hub deletion succeeds (and can also hide the real deletion error if the delete failed). Wrap the refresh call in try/catch or explicitly ignore failures so refresh problems don't override the primary operation.

Suggested change
await commands.executeCommand('azureResourceGroups.refresh');
try {
await commands.executeCommand('azureResourceGroups.refresh');
} catch {
// Ignore refresh failures so they don't override the delete result.
}

Copilot uses AI. Check for mistakes.
}
};
}
Loading