IntersectMBO / IntersectMBO/govtool

🐛 Inconsistent Metadata Validation Response Between Outcome and Live Voting for the Same URL and Hash

Open
#3,149 0 comments 0 reactions 2 assignees Claimed by @profd2004 View on GitHub
🐛 Bug 🕵️‍♂️ Testing
Dominant language
HTML
Stars
21
Forks
29
Avg merge
2d 22h
Merged PRs (30d)
7

Description

#### **Domain**
preview.gov.tools

#### **Context**
- The metadata validator API returns different responses for outcome and live voting when using the same URL and hash.

**URL:** [https://raw.githubusercontent.com/Ryun1/metadata/main/cip100/ga.jsonld](https://raw.githubusercontent.com/Ryun1/metadata/main/cip100/ga.jsonld)
**Hash:** `d57d30d2d03298027fde6d1c887c65da2b98b7ddefab189dcadab9a1d6792fee`

#### **Steps to Reproduce**
1. Use the following cURL command to get the metadata validation response on live voting:
```sh
curl 'https://z6b8d2f7a-z2f6a992f-gtw.z937eb260.rustrocks.fr/validate' \
-H 'sec-ch-ua-platform: "Linux"' \
-H 'Referer: https://preview.gov.tools/' \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36' \
-H 'Accept: application/json, text/plain, */*' \
-H 'sec-ch-ua: "Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"' \
-H 'Content-Type: application/json' \
-H 'sec-ch-ua-mobile: ?0' \
--data-raw '{"url":"https://raw.githubusercontent.com/Ryun1/metadata/main/cip100/ga.jsonld","hash":"d57d30d2d03298027fde6d1c887c65da2b98b7ddefab189dcadab9a1d6792fee","standard":"CIP108"}'
```
Response

```
{"status":"INCORRECT_FORMAT","valid":false}
```
2. Use the following cURL command to get the metadata validation response for the outcome:
```sh
curl 'https://z8bd2599d-zfe84eb01-gtw.z937eb260.rustrocks.fr/governance-actions/metadata?url=https:%2F%2Fraw.githubusercontent.com%2FRyun1%2Fmetadata%2Fmain%2Fcip100%2Fga.jsonld&hash=d57d30d2d03298027fde6d1c887c65da2b98b7ddefab189dcadab9a1d6792fee'
```
Response

```
{"metadataStatus":"INVALID_HASH","metadataValid":false}
```

#### **Actual Behavior**
- The metadata validation response differs between outcome and live voting, despite using the same URL and hash.
- The UI displays two different messages:

**For Outcome:**
![Outcome Message](https://github.com/user-attachments/assets/7b1a2dc2-f673-474f-bd33-8749ec43c75a)

**For Live Voting:**
![Live Voting Message](https://github.com/user-attachments/assets/7cffe810-8c34-4638-9f27-74751bf42bd3)

#### **Expected Behavior**
- When using the same URL and hash, the metadata validator should return the same response for both outcome and live voting.
- The UI should display a consistent metadata validation error message across both views.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.