brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.67k stars 2.31k forks source link

Panel slow to load balance #36693

Open srirambv opened 8 months ago

srirambv commented 8 months ago

Description:

Wallet panel can be slow to load balance. We should utilize balance cache added in https://github.com/brave/brave-browser/issues/35986 to load the balance for the selected Dapp account(s) & networks to display the native token balance quickly to avoid long delays when panel is opened (currently more noticeable on panel with wallets utilizing many networks and/or accounts with balance).

Steps to Reproduce

  1. Restore wallet that has balance in Eth testnet
  2. Connect wallet to a Dapp
  3. Open panel, shows balance as 0
  4. Open wallet and select the token from testnet, shows actual balance

Actual result:

https://github.com/brave/brave-ios/assets/17010094/1cdabdfc-cae4-41bb-93bf-f128dc6980b4

Expected result:

Show balance on panel

Reproduces how often: [Easily reproduced, Intermittent Issue]

Easy

Brave Version:

Device details:

iPhone 13 (iOS 17.4)

Website problems only:

Additional Information

cc: @nuo-xu @StephenHeaps

StephenHeaps commented 8 months ago

Seems like balance fetch is slow here (last frame of video shows balance on the panel). We'll look to see if we can improve this before balance caching lands.

Screenshot 2024-02-01 at 10 23 48 AM