thunderbiscuit / padawan-wallet

The bitcoin wallet trainer on Android.
https://padawanwallet.com/
Apache License 2.0
114 stars 50 forks source link

Handle no network situations #215

Closed thunderbiscuit closed 1 year ago

thunderbiscuit commented 2 years ago

A few problems arise when the app doesn't have access to the network:

  1. If it's on startup, the lateinit blockchain variable is not created, but that doesn't prevent other methods from attempting to use it (sync and getBalance for example), which crashes the app (error is at the Padawan layer).
  2. If it's after startup, the error happens at the bitcoindevkit level, where it attempts a call to the network which fails.

Proposals to deal with this:

  1. A permanent small red/orange/yellow banner at the top of the wallet telling the user the network is not available, so the app will be running in "reduced" mode
  2. Disabling buttons that require network access, OR firing snackbars whenever a network call is being triggered that cannot be completed.

Happy to hear thoughts on this either way.