XML file is deleted when converting a static resource to a bundle

Issue #231 resolved
Matt Addy created an issue

When I right click an application/zip static resource file in the project view and select "Convert To Static Resource Bundle" I'm prompted with a delete dialog that says the associated .resource-meta.xml file will be removed as well. At this point I'm not given any option of choosing "No" and the metadata file is removed.

Another issue is that after clicking "Ok" in this dialog I'm then asked if I want to delete the files from the connected org. Is this intentional? If I select "Yes" here, I believe the static resource components won't be deployable.

This issue prevents me from using static resource bundles.

Comments (7)

  1. Scott Wells repo owner

    Definitely not intentional. Looks like an oversight in the touchpoint between these two features. I'll take care of it for sure.

  2. Scott Wells repo owner

    Easy to reproduce, and I've already implemented a fix that will be included in the next release. I may fast-track it since it does effectively block usage of the static resource bundles feature, though.

  3. Matt Addy Account Deactivated reporter

    Scott, another possible symptom of this issue is when using version control. If I'm on branch A which has MyClass.cls and checkout branch B which does not have MyClass.cls, I'm prompted if I want to delete the files remotely.

    Honestly though, I'm not sure if the above scenario is an issue. I gave it a lot of thought before even mentioning it, because it seems like it might be desired behavior. Especially when I can just select "No". Often times I close the IDE before switching branches, which prevents the dialog from appearing altogether.

    What are your thoughts?

  4. Scott Wells repo owner

    Thanks, Matt. I've seen a few similar manifestations of this where I'm prompted to remove a file from the org (or remove the companion meta.xml file) when I really shouldn't be.

    I'm basically just listening for file delete events in IntelliJ's message bus, scrubbing those events for files that are managed by IC, and then further scrubbing them based on other context such as whether an event is for the contents of a bundle or a bundle itself, in response to a delete that I initiated such as when I convert static resources to bundles and vice-versa (the original source of this bug), etc. Obviously there are other filters that should be applied before deciding to handle an event in this manner, so creating a running list of them is certainly helpful. Hopefully this won't end up being a bunch of one-offs, though. Hopefully with a few examples, I can characterize the exact events I want and white list those rather than the opposite. It's just tricky with IntelliJ/OpenAPI sometimes because it's managing so much of the file activity for you!

  5. Scott Wells repo owner

    To be clear, the original situation around static resource bundle conversion is resolved in 1.6.8.2, not the one when switching branches/projects.

  6. Log in to comment