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

Added token cache reset interval of one week #3038

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

amirsaran3
Copy link

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.

@netlify
Copy link

netlify bot commented Apr 11, 2023

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

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4b8ca0f

@netlify
Copy link

netlify bot commented Apr 11, 2023

👷 Deploy request for near-wallet-staging pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4b8ca0f

Copy link
Contributor

@MaximusHaximus MaximusHaximus left a comment

Choose a reason for hiding this comment

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

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.

@netlify
Copy link

netlify bot commented Apr 18, 2023

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

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4b8ca0f

@amirsaran3
Copy link
Author

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.

Copy link
Contributor

@MaximusHaximus MaximusHaximus left a comment

Choose a reason for hiding this comment

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

Just 2 changes, then this is ready to go.

packages/frontend/src/services/indexer/cache.js Outdated Show resolved Hide resolved
@AmmarHumackicSQA
Copy link

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

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.

4 participants