bitkit
bitkit copied to clipboard
[Bug]: Balances displayed before all values have been determined on wallet restore
Raising off the back of https://github.com/synonymdev/bitkit/issues/1841.
On wallet restore, the main screen is displayed before all balances have been determined. This can mean showing 0 for some balance (or flicking between some value and 0) for a short while before displaying the correct value.
We could either wait at the rocket or give some visual indication on the main screen to minimise confusion, such as some loading icon instead of 0.
Couple of examples of how it behaves atm on restore for two of my wallets:
https://github.com/synonymdev/bitkit/assets/74595920/dbca6291-c876-4731-a9b7-63914ad4a9e3
https://github.com/synonymdev/bitkit/assets/74595920/49673845-6e68-4788-8169-e48c31e360f1
Last month we spoke about this here.
I think we decided on using a spinner instead of displaying 0 in case the balance is still loading.
That's what I thought too but I preferred to check first with you since i am not seing it on Figma. Which spinner do you would like to use?
Our regular, default spinner (see mockup below).
https://github.com/synonymdev/bitkit/assets/81586998/ff756416-c081-4b62-9a6f-09bf8a74157f
This looks like a regression to me, the wallet didn't need loading time before. We should look into why this is happening more before adding a loading UI.
@pwltr It is a regression. One of the previous solutions caused the long black screen bug on startup. Check the issue referenced in the description for history. If we're waiting on data retrieval its probably best that the UI isn't complete blocked.
I think this issue might've been resolved by https://github.com/synonymdev/beignet/pull/75. With LN channels it can take a little while for all funds to appear but I think this is acceptable.
https://github.com/user-attachments/assets/634c4e5e-b6da-4e99-824e-e4d81ac0a552
@pwltr I don't see any improvement with my wallet. I started this recording 5 seconds after restoring and seeing 0 for all balances. Takes a little while to see spending balance and a manual refresh to get my savings.
https://github.com/user-attachments/assets/ea09d7da-f9c5-454d-a231-4a3473b213ad
Likely fixed by https://github.com/synonymdev/bitkit/pull/2210, @catch-21 please retest with your seed.
Tested on c7432721e886dc49b57d9b138f25031a257ab415 This is so much better now, at least for the savings balance. The spending balance can still display 0 for some time (seconds) before showing the true value. It'd be good to have a spinner instead.
Fwiw, loading indicator spinners were added to the prototype in v50.
https://github.com/user-attachments/assets/718abe13-6d31-4265-b0f6-a5e43165cba5
Marking as Done, LN balance is covered by https://github.com/synonymdev/bitkit/issues/2214