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

force:source:push removes entire static resource when single file removed in zipped static resource #1589

Closed
filiprafalowicz opened this issue Jun 24, 2022 · 5 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@filiprafalowicz
Copy link

Summary

When I try remove single file from static resource with content type = application/zip and run sfdx force:source:push then entire static resource is being removed from the org.

Steps To Reproduce:

  1. Create following files:
  • force-app/main/default/staticresources/ZippedResource.resource-meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
    <cacheControl>Public</cacheControl>
    <contentType>application/zip</contentType>
</StaticResource>
  • force-app/main/default/staticresources/ZippedResource/file1.json
{}
  • force-app/main/default/staticresources/ZippedResource/file2.json
{}
  1. Run sfdx force:source:push. Static Resource will be pushed successfully with both files.
  2. Delete one of the files in force-app/main/default/staticresources/ZippedResource directory.
  3. Run sfdx force:source:push again.

Expected result

Only file that was removed from the directory should be removed from the zipped resource in the org.

Actual result

Command output suggest that there was only that one file deleted, but if you go to your scratch org you will notice entire static resource was removed.

System Information

  • Which shell/terminal are you using? (e.g. bash, zsh, powershell 5, powershell 7, cmd.exe, etc.)
    bash
  • If you are using sfdx
    • Run sfdx version --verbose --json
  • If you are using sf
    • Run sf version AND sf plugins --core
  • Paste the output here
{
        "cliVersion": "sfdx-cli/7.156.1",
        "architecture": "darwin-x64",
        "nodeVersion": "node-v16.15.1",
        "pluginVersions": [
                "@oclif/plugin-autocomplete 0.3.0 (core)",
                "@oclif/plugin-commands 1.3.0 (core)",
                "@oclif/plugin-help 3.3.1 (core)",
                "@oclif/plugin-not-found 1.2.6 (core)",
                "@oclif/plugin-plugins 1.10.11 (core)",
                "@oclif/plugin-update 1.5.0 (core)",
                "@oclif/plugin-warn-if-update-available 1.7.3 (core)",
                "@oclif/plugin-which 1.0.4 (core)",
                "@salesforce/lwc-dev-server 2.11.0",
                "@salesforce/sfdx-plugin-lwc-test 0.1.7 (core)",
                "alias 2.1.0 (core)",
                "apex 0.13.0 (core)",
                "auth 2.2.0 (core)",
                "community 2.0.0 (core)",
                "config 1.4.12 (core)",
                "custom-metadata 2.0.0 (core)",
                "data 2.0.4 (core)",
                "generator 2.0.1 (core)",
                "info 2.0.1 (core)",
                "limits 2.0.1 (core)",
                "org 1.13.2 (core)",
                "salesforce-alm 54.6.0 (core)",
                "schema 2.1.1 (core)",
                "sfdx-cli 7.156.1 (core)",
                "signups 1.2.0 (core)",
                "source 2.0.2 (core)",
                "telemetry 2.0.0 (core)",
                "templates 55.0.0 (core)",
                "trust 2.0.0 (core)",
                "user 2.1.0 (core)"
        ],
        "osVersion": "Darwin 21.5.0"
}

Additional information

The same works fine with force:source:legacy:push.

@filiprafalowicz filiprafalowicz added the investigating We're actively investigating this issue label Jun 24, 2022
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@maggiben maggiben added the bug Issue or pull request that identifies or fixes a bug label Jul 5, 2022
@git2gus
Copy link

git2gus bot commented Jul 5, 2022

This issue has been linked to a new work item: W-11385865

@yippie
Copy link

yippie commented Jul 21, 2022

I am hitting this also, the static resource is referenced so the entire source:push is being blocked saying you aren't allowed to delete the static resource even though I am simply removing one file from inside it (an update)

@tehnrd
Copy link

tehnrd commented Sep 16, 2022

Any update or ETA on W-11385865

This issue appears to completely nuke your scratch org with no way to resolve it. You get the following error over and over with no way to resolve:

This static resource is referenced elsewhere in salesforce.com. Remove the usage and try again. : Lightning Web Component Bundle "c:setup" - MODULE - setup. This static resource is referenced elsewhere in salesforce.com. Remove the usage and try again. : Lightning Web Component Bundle "c:barcodeScanner" - MODULE - barcodeScanner. This static resource is referenced elsewhere in salesforce.com. Remove the usage and try again. : Lightning Web Component Bundle "c:csvToRecords" - MODULE - csvToRecords. This static resource is referenced elsewhere in salesforce.com. Remove the usage and try again. : Lightning Web Component Bundle "c:visualSelectEditor" - MODULE - visualSelectEditor. This static resource is referenced elsewhere in salesforce.c

@WillieRuemmele
Copy link
Member

HI @tehnrd @yippie @filiprafalowicz - the fix has been merged and will be available with Thursday's latest-rc build, sorry it took so long

@mshanemc mshanemc closed this as completed Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

6 participants