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

Token on Polygon Mumbai testnet shows collection image, but not token image #6725

Open
hboon opened this issue Apr 25, 2023 · 11 comments
Open
Assignees

Comments

@hboon
Copy link
Member

hboon commented Apr 25, 2023

Token: https://mumbai.polygonscan.com/address/0xC9419ebd3DcBdFf2FaD35a8e13AcA24C26E9A38d
Wallet: hweeboon.eth

It could be because the token's tokenURI(tokenId) value was invalid when it was downloaded, but it has now been fixed

Screenshot 2023-04-25 at 10 25 20 AM

@oa-s
Copy link
Contributor

oa-s commented Apr 25, 2023

yes, it might be, but just tried and i able to see token images
Screenshot 2023-04-25 at 08 22 07

@hboon
Copy link
Member Author

hboon commented Apr 25, 2023

Ok. Can you help do a quick check to see if we just save the URL once and not overwrite it? Don’t have to fix it yet. (But that means maybe we just need a single refresh button on this screen)

@oa-s
Copy link
Contributor

oa-s commented Apr 25, 2023

yes, right, i tried with with simulating rate limitted error, and able to see same issue, looks like we override existed data with fallback, when we are now able to resolve json

@oa-s
Copy link
Contributor

oa-s commented Apr 25, 2023

maybe it better to remove this line?
.catch { _ in return strongSelf.generateTokenJsonFallback(for: tokenId, tokenType: tokenType, address: address) }

@hboon
Copy link
Member Author

hboon commented Apr 25, 2023

@oa-s Hmm.. but no matter what we do/use as fallback, when the tokenUri() returns a URL that works, wouldn't it replace what we stored earlier?

@oa-s
Copy link
Contributor

oa-s commented Apr 25, 2023

even if tokenUri() returns a url that works, the request with that url might fail, in this case we replace failure response with fallback data. we actually replace failure case of fetchJsonFromTokenUri JsonFromTokenUri with fallback data.

@hboon
Copy link
Member Author

hboon commented Apr 25, 2023

the request with that url might fail, in this case we replace failure response with fallback data. we actually replace failure case of fetchJsonFromTokenUri JsonFromTokenUri with fallback data.

But if it eventually succeed, what happens? Am I seeing that it doesn't work on my side because it failed the first time because the tokenUri() returned URI is invalid, and:

A) the result is stored, we never call tokenUri()again to get the updated URI (they fixed it) and get the JSON
B) the result is stored, we call tokenUri() to get the updated URI (they fixed it), but it fails because of network issues and it keeps failing?

I thought it is A, and that's why I thought maybe a refresh button to force a refresh would fix it. But it sounds like you are describing B, but B sound like it would fail very often?

@oa-s
Copy link
Contributor

oa-s commented Apr 25, 2023

A) the result is stored, we never call tokenUri()again to get the updated URI (they fixed it) and get the JSON

we always call tokenUri() when trying to get json for token id, url don't caching

@hboon
Copy link
Member Author

hboon commented Apr 25, 2023

So if we always call tokenUri() to get the current URL, it should work for me right?

@hboon
Copy link
Member Author

hboon commented Apr 25, 2023

But if you’d like and it’s a simple, try pushing a PR and I can test against mine state to see if it fixes it?

@oa-s
Copy link
Contributor

oa-s commented Apr 25, 2023

So if we always call tokenUri() to get the current URL, it should work for me right?

yes

oa-s added a commit that referenced this issue Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants