alpha-wallet-ios
alpha-wallet-ios copied to clipboard
Token on Polygon Mumbai testnet shows collection image, but not token image
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
yes, it might be, but just tried and i able to see token images

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)
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
maybe it better to remove this line?
.catch { _ in return strongSelf.generateTokenJsonFallback(for: tokenId, tokenType: tokenType, address: address) }
@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?
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.
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?
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
So if we always call tokenUri() to get the current URL, it should work for me right?
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?
So if we always call tokenUri() to get the current URL, it should work for me right?
yes