Deleting a file doesn't remove it from SFDX source tracking

Issue #1896 resolved
Riadh Mankai created an issue

Here is the scenario. Please let me know if I’m doing something wrong:

  • I want to delete a class that exists both locally and in my scratch org
  • I go the the class in my Webstorm, I do a right click, I select Illuminated Cloud → Delete Metadata
  • IE deletes the class from the server (the scratch org), but no locally (Problem 1)
  • Because IE only deleted the class files in the server, I go and manually deletes the class files using my local file system
  • So far so good, until I try to push -f something to the scratch org, here the SFDX source tracking tells me that it couldn’t find the deleted class. I was expecting this class to be deleted from the SFDX source tracking as well (problem 2)

Thank you.

Comments (1)

  1. Scott Wells repo owner

    Hi. The Delete Metadata action is explicitly for removing the metadata from the server directly via the API and without removing it from the local filesystem/project. If you'd like to remove a file via source tracking, just use the IDE's standard Delete... action which will remove the file and then, on the next SFDX push, the CLI will propagate that local removal to the scratch org.

    You can find more information on metadata removal here:

    https://bitbucket.org/RoseSilverSoftware/illuminatedcloud/wiki/User_Guide/Removing_Metadata.md

    Resolving the issue based on the information above, but if the provided information doesn't work as-described, please feel free to reopen with additional details.

  2. Log in to comment