threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

🐞 [Bug]: Gateway contract isn't deleted after deleting CasperLabs instance #2621

Closed A-Harby closed 3 months ago

A-Harby commented 5 months ago

Is there an existing issue for this?

which package/s did you face the problem with?

Dashboard

What happened?

After deleting a Casper Labs instance from its solution page, I found a contract of gateway type wasn't deleted.

https://github.com/threefoldtech/tf-images/issues/226#issuecomment-2081513550

Steps To Reproduce

No response

which network/s did you face the problem on?

QA

version

2.4.0-rc1

Twin ID/s

52

Node ID/s

3

Farm ID/s

1

Contract ID/s

27305

Relevant screenshots/screen records

image

image

Relevant log output

{
  "version": 0,
  "twin_id": 52,
  "contract_id": 27305,
  "metadata": "",
  "description": "",
  "expiration": 0,
  "signature_requirement": {
    "requests": [
      {
        "twin_id": 52,
        "required": false,
        "weight": 1
      }
    ],
    "weight_required": 1,
    "signatures": [
      {
        "twin_id": 52,
        "signature": "80bb14dd44dbb0e0b3733fb440360c36ce2d7eade34d4dad1fda0c2f45249a6494650f4ea108e7b0de459ed425f566329e15babb0d66a027c89550b330713780",
        "signature_type": "sr25519"
      }
    ],
    "signature_style": ""
  },
  "workloads": [
    {
      "version": 0,
      "name": "cl52clv2dtc",
      "type": "gateway-name-proxy",
      "data": {
        "name": "cl52clv2dtc",
        "tls_passthrough": false,
        "backends": [
          "http://10.20.4.2:80"
        ],
        "network": "nwkcdiv"
      },
      "metadata": "",
      "description": "",
      "result": {
        "created": 1714306116,
        "state": "ok",
        "message": "",
        "data": {
          "fqdn": "cl52clv2dtc.gent02.qa.grid.tf"
        }
      }
    }
  ]
}
Mahmoud-Emad commented 5 months ago

Issue Update

Investigation and Solution:

Indeed, the issue persists. It appears that the project name is not being included in the solutionHasGateway function, causing it to return true if the solution has a gateway, and false if not. To resolve this, we need to ensure that the project name is properly integrated into the solutionHasGateway function's logic.

Mahmoud-Emad commented 5 months ago

Issue update

Work done

Fix deleting the gateway contract in the Casperlabs solution by adding the 'Casperlabs' project name in the solutionHasGateway function.

Changes

Screenshots/Video

Screencast from 05-07-2024 02:12:16 PM.webm

A-Harby commented 3 months ago

Verified, Devnet 1b19f4f,

I deployed a few solution instance that use a gateway then deleted them, and wasn't able to reproduce the case again.

image

image