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

NftController.updateNftMetadata called with too many NFTs at once causes 429 error #5047

Open
zakariamouhid opened this issue Dec 9, 2024 · 0 comments

Comments

@zakariamouhid
Copy link

Issue

I have about 1949 nfts on base sepolia testnet
using sepolia.base.org as a provider
most of those nfts are testing nfts that have broken images (empty string)
the NftController.updateNftMetadata is beign called with too many nfts at once (see attached images)

Cause

the issue is caused by using Promise.all to call getNftInformation

const nftMetadataResults = await Promise.all(
nftsWithChecksumAdr.map(async (nft) => {
const resMetadata = await this.#getNftInformation(
nft.address,
nft.tokenId,
networkClientId,
);
return {
nft,
newMetadata: resMetadata,
};
}),
);

Proposed Solutions

instead should limit the number of the getNftInformation calls at once
could use one of those packages
https://www.npmjs.com/package/promise-concurrency
https://www.npmjs.com/package/promise-limit
or should only refresh a few broken nfts each time, and keep track of the last updated timestamp

Images from MetaMask extension service worker on chrome

Image
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants