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

feat(wallet): attempt to re-fetch tokenMetadata/nftMetadata if provid… #464

Conversation

mirceahasegan
Copy link
Collaborator

@mirceahasegan mirceahasegan commented Sep 26, 2022

Context

AssetInfo tokenMetadata/nftMetadata undefined means that the metadata could not be fetched.
We should still emit the partial AssetInfo, but also refetch refetch the metadata until it is successfully retrieved.

Proposed Solution

  • Enhance coldObservableProvider with pollUntil, enabling it to retry until the condition is met.
  • AssetsService will pollUntil AssetInfo tokenMetadata and nftMetadata are either null or defined

Important Changes Introduced

Copy link
Member

@rhyslbw rhyslbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

packages/wallet/src/services/AssetsTracker.ts Outdated Show resolved Hide resolved
Copy link
Member

@mkazlauskas mkazlauskas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Just a small change request for debug message

packages/wallet/src/services/AssetsTracker.ts Outdated Show resolved Hide resolved
mkazlauskas
mkazlauskas previously approved these changes Sep 27, 2022
rhyslbw
rhyslbw previously approved these changes Sep 28, 2022
Copy link
Member

@rhyslbw rhyslbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @mirceahasegan 🚀

@rhyslbw rhyslbw dismissed stale reviews from mkazlauskas and themself via 2800f9c September 28, 2022 01:39
@rhyslbw rhyslbw force-pushed the feat/re-fetch-token-and-nft-metadata-if-provider-returns-it-as-undefined branch from 147b1d0 to 2800f9c Compare September 28, 2022 01:39
@rhyslbw rhyslbw self-requested a review September 28, 2022 01:39
@mirceahasegan
Copy link
Collaborator Author

PR #466 must be merged before this one.
Otherwise, nonNFT assets will poll forever because cardano-services returns undefined nftMetadata

Copy link
Collaborator Author

@mirceahasegan mirceahasegan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #466 must be merged before this one.
Otherwise, nonNFT assets will poll forever because cardano-services returns undefined nftMetadata

@rhyslbw rhyslbw merged commit 4afdf79 into master Sep 28, 2022
@rhyslbw rhyslbw deleted the feat/re-fetch-token-and-nft-metadata-if-provider-returns-it-as-undefined branch September 28, 2022 12:31
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 this pull request may close these issues.

3 participants