thunderbiscuit / padawan-wallet

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

Generalize the errors displayed in snackbar #191

Closed masterchief164 closed 1 year ago

masterchief164 commented 2 years ago

As of now, the snackbar displays error messages which are not understandable by common users. It would be better to handle a few common types of errors and display the corresponding error in the snackbar. We can log the error details and use them for debugging.

thunderbiscuit commented 2 years ago

Great idea. +1

Sujal3013 commented 1 year ago

If this issue is open,I would like to work upon this issue.

thunderbiscuit commented 1 year ago

Sure! Feel free to try and generate some of those errors and take screenshots. Maybe we can think of ways to handle specific ones differently. You'll notice that the issue is that those errors sometimes come from the Electrum call to broadcast a transaction, so there can be many types. But for sure we can make them better. Maybe bigger snackbars and a parse of the error message to only display the message part (as opposed to the whole JSON error output it currently displays).

Something else would be to add a dismiss button to the snackbar as opposed to simply letting it disappear.

Ayan-10 commented 1 year ago

@thunderbiscuit Can you elaborate a little on this issue? Currently, the app directly shows the error messages on the snack bar like java.lang.UnsatisfiedLinkError: Unable to load library 'bdkffi':, what should the snack bar show in this case?

guptasandeep7 commented 1 year ago

It shows an unclear message when the amount is zero. We can add a condition to check whether the amount is valid or not before calling to verify transaction. image

thunderbiscuit commented 1 year ago

@Ayan-10 I think your issue is because you're using an emulator that is not supported. Are you on Windows by any chance? If you're on macOS it's because you're using a 32-bit emulator, and need to download a 64-bit one.

thunderbiscuit commented 1 year ago

@guptasandeep7 good catch! Yes let's display a nicer error in that instance. A 0 amount is clearly not going to work. Here in this case it's also that the output is below the dust amount, and I'm not sure what exactly is the dust amount anymore (or is it dynamic? Can't remember).

Feel free to dig into this a little bit if you want and we could display two separate errors: amount is 0 and amount is below the dust limit. They don't have to be dealt with in the same PR.

Ayan-10 commented 1 year ago

Thanks @thunderbiscuit The emulator issue is resolved.