-
Notifications
You must be signed in to change notification settings - Fork 49
Useful error messages on connecting, unlock wallet #45
Useful error messages on connecting, unlock wallet #45
Conversation
- unlock wallet - timeout for info request - catch errors on certificate and macaroon - useful error messages with solution suggestions.
- this is only a temporary solution, which deserves a better solution in a separate PR
A few updates to this PR:
|
app/src/main/java/zapsolutions/zap/setup/ConnectRemoteNodeActivity.java
Outdated
Show resolved
Hide resolved
app/src/main/java/zapsolutions/zap/connection/lndConnect/LndConnectStringResult.java
Outdated
Show resolved
Hide resolved
mWalletConnectedLayout.setVisibility(View.GONE); | ||
mWalletNotConnectedLayout.setVisibility(View.GONE); | ||
mLoadingWalletLayout.setVisibility(View.VISIBLE); | ||
Wallet.getInstance().isLNDReachable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should rename this function, since its not clearly expressing that it is used to establish a connection.
I know it is implicit but maybe we can make it more clear.
In this specific usecase for example, when one is "retrying" you would expect to do something like connect or establishConnection, so a call to check for reachability could be a bit misleading.
(e.g. we split the function into a connect()
and a isReachable()
where possible both do the same or even connect()
is internally just calling isReachable()
.)
Just a minor thing but maybe you feel the same.
- increased wallet unlock delay to 10 - added error constants for WalletLoadedListener interface - reworked LndConnectString parser - created a more reuseable LndConnectionConfig class - changed gradle option for unit tests - typo fixes - added inernet connection hint to the timeout error
<string name="error_qr_code_result_null">QR-Code konnte nicht gelesen werden, bitte versuch es noch einmal.</string> | ||
<string name="error_connection_unsupported_format">Dieses Format wird leider nicht ünterstützt.\nBitte verwende das lndconnect Format.\n\nlndconnect://...</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ünterstützt 😃
<string name="error_connection_invalid_host_or_port">Der angegebene Host oder Port is ungültig.</string> | ||
<string name="error_connection_invalid_macaroon2">Zugriff verweigert!\n\nDas Macaroon ist ungültig.</string> | ||
<string name="error_connection_server_unreachable">Zeitüberschreitung.\nDer Server ist nicht erreichbar.\n\n- Bitte stelle sicher, dass du eine gute Internetverbindung hast\n\n- Überprüfe ob der Server läuft und unter folgender IP-Adresse erreichbar ist:\n\n%1$s</string> | ||
<string name="error_connection_lnd_unavailable">Die Verbindung zum LND kann nicht hergestellt werden.\n\n- stelle sicher, dass der LND deamon auf dem server läuft.\n\n- stelle sicher, dass Port forwarding aktiviert ist. (Port: %1$s)\n\n- stelle sicher, dass das Zertifikat gültig ist.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe capitalize Server
@@ -1405,7 +1495,14 @@ public void unregisterWalletLoadedListener(WalletLoadedListener listener) { | |||
} | |||
|
|||
public interface WalletLoadedListener { | |||
void onWalletLoadedUpdated(boolean success, String error); | |||
|
|||
int ERROR_LOCKED = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This PR has 2 main parts:
Motivation and Context
Zap should be easy to use. Right now there are bad error messages that are not really helpful if the connection can not be established.
This PR tries to make the process of connection a lot more simpler by providing useful information.
Furthermore it is now possible to access a locked wallet and unlock it from within the app.
How Has This Been Tested?
It was tested with lnd 0.6.1-beta, Samsung S9, API 29
Screenshots (if appropriate):
Types of changes
Checklist: