IntersectMBO / IntersectMBO/govtool
🐛 Metadata Validation Issues in Outcome and Live Voting
- Dominant language
- HTML
- Stars
- 21
- Forks
- 29
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 7
Description
### Context
#### 1. Live Voting
- According to the [metadata error condition: Data Not Verifiable](https://docs.gov.tools/cardano-govtool/using-govtool/dreps/drep-error-conditions#:~:text=the%20DRep%20spec.-,Data%20Not%20Verifiable,-The%20data%20that), if the hash does not match the hash of the metadata URL and the data format is incorrect, the validation API should return **"Invalid hash"**.
- However, in live voting, when governance action metadata validation fails due to an incorrect hash and governance action format, it incorrectly returns **"Data formatted incorrectly"** instead of **"Data not verifiable"**.
#### 2. Outcomes
- As per the [metadata error condition: Data Formatted Incorrectly](https://docs.gov.tools/cardano-govtool/using-govtool/dreps/drep-error-conditions#:~:text=they%20originally%20registered-,Data%20Formatted%20Incorrectly,-The%20data%20that), if the hash matches the metadata URL hash but the data format is invalid, it should return **"Data formatted incorrectly"** instead of valid metadata.
- Example request:
```
https://z8bd2599d-zfe84eb01-gtw.z937eb260.rustrocks.fr/governance-actions/metadata?url=https://metadata-govtool.cardanoapi.io/data/Lolita&hash=62a37df07103f0a69690c8975700e06b7c3c3069cb3d105abec00e820e831dda
```
- Expected response: **"Incorrect Format"** with `"metadataValid": false`.
- Actual response:
```json
{
"metadataValid": true,
"data": {
"givenName": "Doyle",
"image": {
"@type": "ImageObject",
"contentUrl": "https://avatars.githubusercontent.com/u/89786962",
"sha256": "f689efaa4690e135f5a0a9d5349e37b853867d4e7ddb4cc6e4ca657d1c05d8ab"
},
"motivations": "Catena solum confugo delectatio. Spiculum perferendis deinde succedo ager laborum aetas solitudo ver.",
"objectives": "Suspendo minus venio commemoro cuius placeat coepi. Coruscus magnam hic decerno accedo peior.",
"paymentAddress": "addr_test1qr9sl8jvztc0qrafle0x2p52eu6ea2jslelsw6cmtyc8wwumejxff5phngxwtp8jc9sy2qnqmeupy4eedpsyf9akty2sue298u",
"qualifications": "Cinis consectetur carbo thymbra curto ducimus. Tot volup turbo succurro beatae vulgaris vulpes.",
"references": [
{
"@type": "Other",
"label": "Label",
"uri": "https://thunderous-fennel.info"
}
]
}
}
```
- This indicates that **"Data formatted incorrectly"** validation is missing in outcome metadata validation.
Additionally, there is an issue where the **breadcrumb title remains stuck in a loading state** and displays an empty title for incorrectly formatted governance actions.

### Actual Behavior
- In live voting, metadata validation incorrectly returns **"Data formatted incorrectly"** instead of **"Data not verifiable"** when the metadata hash does not match the hash of the metadata URL.
- The **"Data formatted incorrectly"** validation is missing in outcome metadata validation.
### Expected Behavior
- The system should implement **proper metadata validation** for both **live voting and outcomes** to ensure accurate error handling.
### Allure Reports
- [4P_4: Should display "Data Not Verifiable" message in live voting when the metadata hash does not match the URL and has an incorrect governance action format](https://intersectmbo.github.io/govtool-test-reports/govtool-frontend/352/#behaviors/1523ff4143db0faaf245e2252e8ca520/5263cad5b334ce33/)
- [9H_1: Should display "Data Formatted Incorrectly" message in outcomes when the hash is valid but the metadata format is incorrect](https://intersectmbo.github.io/govtool-test-reports/govtool-frontend/352/#behaviors/cd141c5190a2f8a50cd2736eebc2b8cc/1c7a61f0a16f2c64/)
Contributor guide
Assessment
This issue has not been assessed yet.