Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing walkContent on delete prompt #986

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Conversation

mshanemc
Copy link
Contributor

What does this PR do?

This bug happens when you use delete command with a remote-only piece of metadata. The confirmation prompt throws an error.

change how we determine "is it a sourceComponent?" so we don't get an unsafe walkContent() access.

[I tried to create a NUT for this but the interactive command framework won't allow commands with spaces in them, will resolve that separately in testkit]

What issues does this PR fix or reference?

forcedotcom/cli#2836
@W-15572525@

@cristiand391
Copy link
Member

QA notes:

setup:
sf v2.38.7
created Wowowo apex class in org without retrieving it.

➜  dreamhouse-lwc git:(main) sf project delete source -m ApexClass:Wowowo
Error (10): c.walkContent is not a function or its return value is not iterable

✅ can delete remote-only metadata

➜  dreamhouse-lwc git:(main) sf project delete source -m ApexClass:Wowowo
 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
? This operation will delete the following metadata in your org:
ApexClass:Wowowo
Are you sure you want to proceed? no
Error (1): The request to delete metadata was canceled.

➜  dreamhouse-lwc git:(main) sf project delete source -m ApexClass:Wowowo
 ›   Warning: @salesforce/plugin-deploy-retrieve is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.
? This operation will delete the following metadata in your org:
ApexClass:Wowowo
Are you sure you want to proceed? yes
*** Deleting with SOAP API ***
Status: In Progress | ████████████████████████████████████████ | 0/0 Components



Status: Succeeded | ████████████████████████████████████████ | 1/1 Components


=== Deleted Source

 FULL NAME TYPE      PROJECT PATH
 ───────── ───────── ────────────
 Wowowo    ApexClass

@cristiand391 cristiand391 merged commit 415ad2d into main Apr 22, 2024
40 checks passed
@cristiand391 cristiand391 deleted the sm/delete-prompt-bug branch April 22, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants