near-wallet icon indicating copy to clipboard operation
near-wallet copied to clipboard

Added token cache reset interval of one week

Open amirsaran3 opened this issue 1 year ago • 5 comments

A large amount of users are raising an issue that they can't see fungible tokens in their near wallet. Indexer and RPC endpoints are returning the tokens correctly, but the issue is still there. There is a big chance that it the problem with the near wallet caching not updating properly.

I added a cache reset for every week so that the cache is synced with the blockchain.

amirsaran3 avatar Apr 11 '23 09:04 amirsaran3

Deploy request for glittering-pavlova-0e9247 pending review.

Visit the deploys page to approve it

Name Link
Latest commit 4b8ca0f7bbf97b50932e17b12fb6100a853c8560

netlify[bot] avatar Apr 11 '23 09:04 netlify[bot]

Deploy request for near-wallet-staging pending review.

Visit the deploys page to approve it

Name Link
Latest commit 4b8ca0f7bbf97b50932e17b12fb6100a853c8560

netlify[bot] avatar Apr 11 '23 09:04 netlify[bot]

Deploy request for unrivaled-zabaione-2fe19c pending review.

Visit the deploys page to approve it

Name Link
Latest commit 4b8ca0f7bbf97b50932e17b12fb6100a853c8560

netlify[bot] avatar Apr 18 '23 13:04 netlify[bot]

If I'm reading this correctly, this change will only reset the cache if it hasn't been updated for a week -- in the case of a poisoned cache, it may be updated regularly but still invalid -- we want to intermittently clear the cache even if we've updated it regularly and recently. To accomplish this, we will need to set a separate timestamp to track the age of the cache since originally created, then check against that value instead of the last updated timestamp.

Updated accordingly.

amirsaran3 avatar Apr 19 '23 15:04 amirsaran3

Hey @andy-haynes , would you mind checking this PR from before? Thanks!

AmmarHumackicSQA avatar Aug 15 '23 09:08 AmmarHumackicSQA