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

Unsupported proposal metadata preventing application use #146

Open
ryanchristo opened this issue Aug 29, 2023 · 7 comments · Fixed by #149
Open

Unsupported proposal metadata preventing application use #146

ryanchristo opened this issue Aug 29, 2023 · 7 comments · Fixed by #149
Assignees
Labels
bug Something isn't working dev Engineering task

Comments

@ryanchristo
Copy link
Member

ryanchristo commented Aug 29, 2023

Originally reported by @S4mmyb in slack.

If a user submits a group proposal using the CLI and the metadata for the proposal is not a valid JSON string, the group page and the proposal page is inaccessible to the user.

A user should be able to continue using the application regardless of how the metadata within a proposal is formatted (i.e. we should have fallbacks in place). The proposal metadata should also support IPFS (same as group and policy metadata).

This occurred as a result of a user submitting the following proposal:

{
 "group_policy_address": "regen1ys0dhh6x5s55h2g37zrnc7kh630jfq5p77as8pwyn60ax9zzqh9q4reeah",
 "messages": [
  {
   "@type": "/cosmos.group.v1.MsgCreateGroupPolicy",
   "admin": "regen1ys0dhh6x5s55h2g37zrnc7kh630jfq5p77as8pwyn60ax9zzqh9q4reeah",
   "group_id": "6",
   "metadata": "{\"name\": \"Biochar Carbon Credit Class Buffer Pool Account\"}",
   "decision_policy": {
        "@type": "/cosmos.group.v1.PercentageDecisionPolicy",
        "percentage": "1",
        "windows": {
            "voting_period": "120h",
            "min_execution_period": "0s"
        }
    }
  }
 ],
 "metadata": "ipfs://CID",
 "proposers": ["regen1v2ncquer9r2ytlkxh2djmmsq3e8we6rjc9snfn"]
}

Notice that the proposal metadata is ipfs://CID. This prevents the following group page from being accessible:

@ryanchristo
Copy link
Member Author

Hey team! Please add your planning poker estimate with Zenhub @ryanchristo @blushi @wgwz @flagrede

@wgwz wgwz self-assigned this Sep 6, 2023
@wgwz
Copy link
Contributor

wgwz commented Sep 12, 2023

Do we want to fetch the CID from gateways? I.e. we have handful of trusted gateways, and we try to fetch the CID from those. Or do we want to use something like helia so we can actually fetch via ipfs protocol? (helia was previously js-ipfs) I think I saw it recommended that you first try to fetch from an ipfs node, and then use gateways as fallbacks.

https://github.com/ipfs/helia
https://github.com/ipfs/js-ipfs

@ryanchristo
Copy link
Member Author

No need to rethink how we are fetching data. We already have that implemented. The issue here is that application is expecting JSON when provided a string. We should be able to fix this without rethinking how we fetch data.

Screenshot from 2023-09-11 20-53-55

@wgwz
Copy link
Contributor

wgwz commented Sep 12, 2023

My mistake, I didn’t realize we already had the ability to fetch ipfs data in the codebase.

@clevinson
Copy link
Member

Re-opening as #149 did not actually resolve this issue fully. The group page at https://groups.regen.network/6 does not render still.

@blushi @aaronc I think this should be a pretty easy fix. Would be great if one of you can take a look at it, since this prevents us from being able to use groups UI for administering the KCT credit class.

@blushi blushi assigned blushi and unassigned wgwz Nov 7, 2023
@blushi
Copy link
Member

blushi commented Nov 7, 2023

It looks like this is because the fix hasn't been pushed to main yet: main...dev
Using the deploy preview from Kyle's fix branch, it's working fine: https://deploy-preview-149--regen-groups-ui.netlify.app/6
Are we ok to publish a new release with the changes linked above? @clevinson @ryanchristo If so, I can prepare the release PR dev->main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev Engineering task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants