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

Consumer-Asset with the same ID as a Provider-Asset Cannot Be Deleted After Contract Negotiation #4583

Open
efiege opened this issue Oct 25, 2024 · 1 comment
Labels
bug_report Suspected bugs, awaiting triage

Comments

@efiege
Copy link

efiege commented Oct 25, 2024

Bug Report

Describe the Bug

After a Contract for an Asset of a Provider has successfully been negotiated, an Asset reciding at the Consumer with the same ID and not being part of a Contract, can not be deleted anymore.

Expected Behavior

Asset can be deleted, because it has not been part of a contract.

Observed Behavior

Asset can't be deleted.

Steps to Reproduce

  1. Create and negotiate a Contract for Asset-A reciding at the Provider
  2. Create Asset-B with the same ID as Asset-A at the Consumer
  3. Try to delete Asset-B using the Management-API

Context Information

  • Used version: v0.7.2

Possible Implementation

Query just for Assets with ContractNegotations of type PROVIDER in the AssetServiceImpl.

var query = QuerySpec.Builder.newInstance()
.filter(List.of(new Criterion(ASSET_ID_QUERY, "=", assetId)))
.build();
try (var negotiationsOnAsset = contractNegotiationStore.queryNegotiations(query)) {
if (negotiationsOnAsset.findAny().isPresent()) {
return ServiceResult.conflict(format("Asset %s cannot be deleted as it is referenced by at least one contract agreement", assetId));
}
}

@github-actions github-actions bot added the triage all new issues awaiting classification label Oct 25, 2024
@ndr-brt
Copy link
Member

ndr-brt commented Nov 6, 2024

This should never happen because the identifier of the dataset (asset)

is a text string which is assigned to the resource to provide an unambiguous reference within a particular context.

(ref.)

this is an edge case that won't get prioritized, but we're open to contributions in form of PR.

@ndr-brt ndr-brt added bug_report Suspected bugs, awaiting triage and removed triage all new issues awaiting classification labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug_report Suspected bugs, awaiting triage
Projects
None yet
Development

No branches or pull requests

2 participants