sovity/edc-ce

Consumer: assets cannot be deleted when contract exists referencing provider-asset with same assetid like at the consumer

Opened this issue · 1 comments

Description - What happened? *

If a consumer has a contract with a provider and then creates a new asset as a consumer with the same asset-id as the provider, this newly created asset can not be deleted at the consumer, even though it has nothing to do with the existing contract.

Expected Behavior *

On the consumer side, this asset should be able to be deleted since it does not appear in any contract or contract definition and simply has the same asset-id like the asset at the provider.

Observed Behavior *

Asset at the consumer can't be deleted.

Steps to Reproduce

Provider:

  1. create asset with ID "test"
  2. create contract-definition for asset "test" using for example the always-true policy

Consumer:
3. get the provider catalog and initiate a contract negotiation for the created testing contract-definition and let it end successful in a contract
4. create an asset with the same ID "test" at the consumer
5. try to delete the created asset "test" at the consumer -> can not be deleted
Note: The consumer asset "test" does not have any contract definition

Context Information

No response

Relevant log output

API-Wrapper Log in Backend:
de.sovity.edc.ext.wrapper.api.ServiceException: Asset test cannot be deleted as it is referenced by at least one contract Agreement

Management-API (DELETE /api/management/v3/assets/test):
[
{
"message": "Asset test cannot be deleted as it is referenced by at least one contract agreement",
"type": "ObjectConflict",
"path": null,
"invalidValue": null
}
]

Screenshots

No response