From 2d3cca2709deec8e9532fca426000a101b9f5954 Mon Sep 17 00:00:00 2001 From: Aparna Goyal Date: Wed, 2 Dec 2026 04:04:13 +0530 Subject: [PATCH] fix: draw the delete progress only once the deploy is sent project delete source drew the Deleting Metadata box before ComponentSet.deploy ran. When the deploy was refused before it was sent, the empty box stayed on screen after the error. The box is now drawn once the deploy has started, so a refused delete shows only its error. --- src/commands/project/delete/source.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/commands/project/delete/source.ts b/src/commands/project/delete/source.ts index 567bedb7..9366dd28 100644 --- a/src/commands/project/delete/source.ts +++ b/src/commands/project/delete/source.ts @@ -317,14 +317,10 @@ Update the .forceignore file and try again.`); // fire predeploy event for the delete await Lifecycle.getInstance().emit('predeploy', this.components); - const stages = new DeployStages({ - title: 'Deleting Metadata', - jsonEnabled: this.jsonEnabled(), - }); - const isRest = (await resolveApi()) === API['REST']; - stages.update({ message: `Deleting with ${isRest ? 'REST' : 'SOAP'} API` }); + // Start the progress output only once the deploy is sent, so a delete refused before it is sent + // shows just its error. const deploy = await this.componentSet.deploy({ usernameOrConnection: this.org.getUsername() as string, apiOptions: { @@ -335,6 +331,11 @@ Update the .forceignore file and try again.`); }, }); + const stages = new DeployStages({ + title: 'Deleting Metadata', + jsonEnabled: this.jsonEnabled(), + }); + stages.update({ message: `Deleting with ${isRest ? 'REST' : 'SOAP'} API` }); stages.start({ deploy, username: this.org.getUsername() }); this.deployResult = await deploy.pollStatus({ timeout: this.flags.wait }); if (!deploy.id) {