eclipse-edc / MinimumViableDataspace

Guidance on documentation, scripts and integration steps on using the EDC project results
Apache License 2.0
58 stars 167 forks source link

Contracts negotiated are duplicated for the same company. #122

Closed aramirezarsys closed 1 year ago

aramirezarsys commented 1 year ago

Bug Report

Describe the Bug

When MVD uses DataDashboard and pushes Negotiate button then 2 identical contracts are created in background behaviour.

Expected Behavior

Only 1 contract should be created.

Observed Behavior

2 identical contracts are created, only 1 should be created.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run the system with following commands:
    cd /home/aramirez/PROJECTS/aramirez/REPOSITORIES/EDC-MinimumViableDataspace;
    export MVD_UI_PATH=/home/aramirez/PROJECTS/aramirez/REPOSITORIES/EDC-MinimumViableDataspace/DataDashboard;
    docker compose --verbose --profile ui -f system-tests/docker-compose.yml up --build;
  2. Access to UI via your ip and port, next one is an example http://82.223.77.67:7080 this is the UI for "company1", take this into account.
  3. Go to "Catalog Browser" section
  4. Click "Negotiate" in asset "test-document-2_company1" or "test-document_company1"
  5. Go to "Contracts" section
  6. As you can see there are 2 contracts for same asset.
  7. Now go to "Catalog Browser" section again
  8. Click "Negotiate" for an asset that is not in company1
  9. Go to "Contracts" section again
  10. As you can see there is only 1 contract for the asset that is NOT for company1.
  11. You can repeat steps from 3 to 10 as many times as you want, it always happends the same.

Context Information

Detailed Description

Detaile before above.

Possible Implementation

The problem can be only likely when using, for example, company1 UI to negotiate a contract which asset is in the same company, in this case company1

bscholtes1A commented 1 year ago

Hello, these contracts are not the same, as they have different start/end dates. We might imagine that some consumer want to renew their contract with another company before their current contract is expired. So it makes sense to enable several contracts to coexist.

Also keep it mind that in the MVD, contract are automatically approved on request. In real flows, the establishment of a contract between the two parties would first go through different approval steps (possibly manual).