Frustratingly, ContentAsset
does not have an entry in the documentation on Components Available in Managed Packages. However, the behavior you're describing suggests that this entity is probably subscriber-deleteable.
In general, subscriber-deleteable entities should not be allowed to be deleted if they're referenced by another component in your package (assuming that referencing component is itself not deleteable). This protection isn't always implemented correctly, though. I've seen instances like the one you describe where a customer successfully deletes a component, and package upgrades subsequently fail. The case I've seen before was a Report being deleted despite being used in a Report Chart shown on a Lightning Record Page. This caused package upgrade failures.
This issue, assuming I'm right in diagnosing it based on your description, is really hard to fix. You can probably set up this situation in a mock subscriber org to see if it matches the actual subscriber issue.
There are three things I would recommend you explore here.
Please open a support case with Salesforce and describe the exact circumstances (subscriber org id, currently installed version, version that will not upgrade). Make sure to specify the relationships between the rest of your metadata and that ContentAsset
in the current and upgraded package versions.
You may be able to help the subscriber un-delete the removed component. In the past, I have been able to do this by providing the subscriber with a metadata bundle (the actual deleted component from my managed package, including the namespace, and a package.xml
manifest) and having them deploy it into their org. This does restore the deleted component, but it only works for 30 days after the subscriber's initial deletion. (You can test this in your mock subscriber org after you repro the issue).
You can try to guard against it by establishing component-to-component references that protect the subscriber-deleteable component from deletion. Since you seem to have found a reference that doesn't provide protection, try other components, especially components that are not themselves subscriber-editable or -deleteable. Test with beta packages in your mock subscriber orgs to see if you can block unsafe subscriber deletes.