bitkit icon indicating copy to clipboard operation
bitkit copied to clipboard

[Bug]: Balances displayed before all values have been determined on wallet restore

Open catch-21 opened this issue 1 year ago • 6 comments

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

catch-21 avatar Jun 03 '24 14:06 catch-21

Last month we spoke about this here.

JeanlChristophe avatar Jun 04 '24 08:06 JeanlChristophe

I think we decided on using a spinner instead of displaying 0 in case the balance is still loading.

aldertnl avatar Jun 04 '24 09:06 aldertnl

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?

JeanlChristophe avatar Jun 11 '24 06:06 JeanlChristophe

Our regular, default spinner (see mockup below).

https://github.com/synonymdev/bitkit/assets/81586998/ff756416-c081-4b62-9a6f-09bf8a74157f

aldertnl avatar Jun 25 '24 09:06 aldertnl

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 avatar Jun 28 '24 10:06 pwltr

@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.

catch-21 avatar Jun 28 '24 10:06 catch-21

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 avatar Aug 28 '24 11:08 pwltr

@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

catch-21 avatar Aug 29 '24 11:08 catch-21

Likely fixed by https://github.com/synonymdev/bitkit/pull/2210, @catch-21 please retest with your seed.

pwltr avatar Sep 07 '24 12:09 pwltr

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.

catch-21 avatar Sep 09 '24 17:09 catch-21

Fwiw, loading indicator spinners were added to the prototype in v50.

https://github.com/user-attachments/assets/718abe13-6d31-4265-b0f6-a5e43165cba5

aldertnl avatar Sep 10 '24 09:09 aldertnl

Marking as Done, LN balance is covered by https://github.com/synonymdev/bitkit/issues/2214

catch-21 avatar Sep 10 '24 11:09 catch-21