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

Decouple MetaPtr logic from IPFS Utils #558

Open
apbendi opened this issue Dec 2, 2021 · 6 comments
Open

Decouple MetaPtr logic from IPFS Utils #558

apbendi opened this issue Dec 2, 2021 · 6 comments
Assignees
Labels
app Frontend issues tech debt Technical Debt
Projects

Comments

@apbendi
Copy link
Collaborator

apbendi commented Dec 2, 2021

The functions in the ipfs file should not be aware of MetaPtr's at all. By the time a function related to IPFS is called, we should have already confirmed that the protocol used is IPFS, and should be dealing only with CIDs at this point.

This implies a new utility file is warranted, perhaps utils/data/metaPtrs.ts or similar. Functions in this file should allow uploading and fetching MetaPtr's. Inside these utility functions, we should detect the protocol, then curry the pointer off to the appropriate method to fetch/upload the data for the protocol in question. Currently, the only supported protocols should be 0 (return null on fetch, no-op on upload) or 1 for IPFS, which should pull out the CID and pass it to the aforementioned IPFS utils. Any other protocol ID should throw.

Up a level from this function, in the UI logic inside the app, we should catch if the metaPtr fetch util function throws and gracefully degrade by showing the placeholder image.

@apbendi apbendi added app Frontend issues GR12 Scoped for the GR12 Grant Round release labels Dec 2, 2021
@apbendi apbendi added tech debt Technical Debt and removed GR12 Scoped for the GR12 Grant Round release labels Dec 3, 2021
@jjwoz
Copy link
Contributor

jjwoz commented Dec 3, 2021

@apbendi because I was bored 😆 !

@apbendi
Copy link
Collaborator Author

apbendi commented Dec 3, 2021

Sorry @jjwoz not sure I follow?

@mds1
Copy link
Contributor

mds1 commented Dec 3, 2021

@apbendi During standup you said if someone is bored they can take this issue since it's not urgent haha 😜

@jjwoz
Copy link
Contributor

jjwoz commented Dec 3, 2021

@apbendi what @mds1 said!

@thelostone-mc
Copy link
Collaborator

thelostone-mc commented Dec 6, 2021

LOL this is my fav issue thread till date on dgrants <3

@apbendi
Copy link
Collaborator Author

apbendi commented Dec 7, 2021

lol got it— I am smort

@phutchins phutchins added this to Backlog in dGrants Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Frontend issues tech debt Technical Debt
Projects
dGrants
Backlog
Development

No branches or pull requests

4 participants