bitkit
bitkit copied to clipboard
Lag when restoring wallet and lag displaying funds onchain and on Lightning
Describe the bug
Can lead to confusion of users - did a restore (which was quite slow, compared to previous versions) initially when wallet is restored, initially there is no indication I have funds, now with the recorded version I do have funds onchain, but there is a lag when displaying the funds on LN).
Reproduce
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Screenshots / Recording
https://github.com/synonymdev/bitkit/assets/119061223/f54a2d67-e158-49d8-b631-6971d0519e56
Operating system
Graphene OS Pixel 6A
Bitkit version
v113
Log output
No response
logs attached bitkit_ldk_logs_1712928094902.zip
Pav: The video attached is me restoring for the 2nd time and this time was considerably faster
For me, this is much worse than in @thisispav's recording, with a regtest wallet.
I run on latest master and quite often it doesn't completely succeed, I do get the 'Wallet Restored' confirmation screen, but after I tap on the OK button, the app stays completely black while the logs keep getting spammed with errors related to Electrum connection.
My Wallet Restore Logs
LOG Running "bitkit" with {"rootTag":11}
LOG Wiping app data...
LOG [Error: Folder does not exist]
LOG Syncing Wallet...
LOG [TypeError: Cannot read property 'refreshWallet' of undefined]
LOG Connection to Electrum Server lost, reconnecting...
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Connection to server lost, please retry]
LOG [Error: Connection to server lost, please retry]
LOG [Error: Connection to server lost, please retry]
LOG [Error: Connection to server lost, please retry]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: No LDK account found.]
LOG [Error: No LDK account found.]
DEBUG Sent hypercores to seeder
LOG true
WARN Restoring bitcoin from deprecated backup server.
LOG [Error: No LDK account found.]
LOG Connection to Electrum Server lost, reconnecting...
WARN Restoring bitcoinTestnet from deprecated backup server.
LOG [Error: No LDK account found.]
LOG [Error: com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.]
LOG [Error: com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.]
LOG Error restoring widgets com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.
LOG [Error: com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.]
LOG [Error: com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.]
LOG Error restoring metadata com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.
LOG [Error: com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.]
LOG [Error: com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.]
LOG Error restoring slashtags com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.
LOG [Error: com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.]
LOG [Error: com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.]
LOG Error restoring activity com.reactnativeldk.classes.MissingBackup: Retrieve failed. Missing backup.
LOG Connection to Electrum Server lost, reconnecting...
LOG [Error: close connect]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG true
LOG Connection to Electrum Server lost, reconnecting...
LOG Connection to Electrum Server lost, reconnecting...
LOG [Error: close connect]
LOG [Error: close connect]
LOG [Error: Connection to server lost, please retry]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG [Error: Failed Electrum connection check.]
LOG true
LOG Connection to Electrum Server lost, reconnecting...
LOG Connection to Electrum Server lost, reconnecting...
LOG Connection to Electrum Server lost, reconnecting...
I have to restart the app after restore, because it hangs on black screen.
Then it loads the (wallet) home page correctly and I can manually fix the Electrum connection (sometimes) from Settings → Advanced → Electrum Server, tapping Connect to Host.
Same issue also restoring a mainnet wallet, tested to confirm this isn't related to our electrum server for regtest.
Closing this in favour of:
- #1723
Seem to be more or less the same issue, and that one describes a more critical problem.
This issue is specifically about the delay of correct spending balance showing after wallet restore, which could still be an issue after the "indefinitely black screen" bug is resolved.
Perhaps the fix here is to not display 0 for any balance when it is still waiting for the data response.
Went over this w/ @JeanlChristophe and @catch-21 and we propose to never show zero unless the balance is truly zero.
We'll foresee an indication that balance is loading for users.
With the new design, the dollar value is a dash when the bitcoin balance is zero. The dollar value should also be zero in this scenario but the dash could be used to indicate the balance has not yet been determined.
#1773 might fix the issue
#1773 does does indeed appear to have solved this issue. However, it now doesn't load the wallet until all data has been retrieved, which can take a while in some network conditions, see https://github.com/synonymdev/bitkit/issues/1806.