Conversation
…ents local cache on some bapi calls
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
10 Skipped Deployments
|
|
# Conflicts: # packages/common/src/utils/SafeLocalStorage.ts
There was a problem hiding this comment.
Bug: Unnecessary API Calls Due to Mismanaged Subscriptions
The price fetching interval and visibility change subscription are mismanaged. The SwapController subscription unnecessarily restarts the price update interval and re-registers the visibility change listener on any state change, not just when tokens change. Furthermore, the interval, once started when sourceToken and toToken are present, continues to run and make unnecessary API calls even after these tokens are cleared, as there is no logic to stop it.
packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L143-L147
appkit/packages/scaffold-ui/src/views/w3m-swap-view/index.ts
Lines 143 to 147 in 0992e53
Was this report helpful? Give feedback by reacting with 👍 or 👎
Description
Refactored the
Send,SwapandActivityscreens to improve the efficiency of http calls. Also implemented local caching to some of the blockchain api callsSendpageFetches tokens/price info only if a
tokenis already selected, else they are fetched in token select screenActivitypageAdded temporary local cache to transactions history so users can still refresh the history but not hit the backend everytime the page is opened
Swap0instead of1Type of change
Associated Issues
https://linear.app/reown/issue/APKT-3169/activity-page-http-calls-improvement-proposal
https://linear.app/reown/issue/APKT-3168/send-page-http-calls-improvement-proposal
https://linear.app/reown/issue/APKT-3166/swap-page-http-calls-reduction-proposal
Checklist