-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
main: make error messages more accurate #678
Conversation
Hi @nonfungible-human, thank you so much for the PR! We'll take a look at it and get back to you early next week with next steps. We're evaluating whether it makes sense to do a broader fix here :) It could make sense for us to loop you in on that if you're interested. We'll have more details to share early next week! |
@levmi Okay. Earlier, I changed this PR to a draft because one of the ci tests fails as it is checking for the "incorrect password" message. The test that says it tests for an incorrect password really just returns an error if the node is not available. If the decision is made to move forward with this, that test would need to check for a different message. Also, in integrated mode a different message is returned when the node is locked. |
So, we discussed this internally. First off, thank you so much for your desire and ability to contribute! We’re really excited to have an external contributor pushing on some of these things. Our ideal path forward on this issue would be to include not only the changes that you’ve created here. But also, to take advantage of the new SubServer Status rpc to return even more verbose error messages to help the user and us debug any issues. To do that, you would hit the RPC call used in this function to attain the subserver status (i.e. (
Specifically, here is an example code snippet of what you’ll receive from the RPC call:
The above snippet can return things that are relevant to the user’s inability to login or other unrelated issues. We believe that the flow we’d want is to return errors from the subserver status function if they are related to either the Other error messages from that function (like Does that make sense? Do you feel comfortable with implementing that type of flow? |
Yes, that seems pretty straight forward, and a good way to proceed. I will change it to use the listSubServerStatus function and then modify this PR, possibly by tomorrow but more likely early next week. |
Awesome, thank you so much! Don't hesitate to reach out with any questions! |
@levmi I do have a question. I ran some initial tests for this and some of the error messages it returns are pretty long and seem to contain multiple messages. Should the entire message be display on the user interface in all of these cases? I tested 3 common error conditions (wrong password, node locked, node not running) in both remote and integrated mode. The following results are what I receive for "lit" and "lnd" when calling remote mode, with lnd node running and unlocked, wrong password enteredThe error message for lit could be used here, but it is rather long and somewhat ambiguous. For example, the only part of the message that indicates that the problem is an incorrect password is
remote mode, with lnd node running but locked, correct password enteredNeither one has an error message, but
remote mode, with lnd node not running, correct password enteredBoth lit and lnd have an error message. The message for lnd is pretty long. The message for lit could be used in this case.
integrated mode, with lnd node running and unlocked, wrong password enteredIn this case, we would use the generic message
integrated mode, with lnd node running but locked, correct password enteredIn this case, we would use the generic message
integrated mode, lnd not runningThis case was not tested. |
Hiya - doing some testing on our side and then will get back to you with a response on the above questions! I think what we want to make sure of is that if we're going to change the error messages in the UX to be more descriptive of the problem from an end user perspective that they aren't incorrect in certain cases. For instance, in the first case, with returning |
@levmi Okay, sounds great. Those were exactly my concerns too, that we always use a reliable message to display something the user can easily understand. I will wait until I hear back from you. |
Hi @nonfungible-human! First of all, once again, thanks a lot for taking the time to contributing to this repo, it's really appreciated 🙏🔥!!! I'll detail an answer to your questions one by one below. First of all, I think I need to clarify that we would like to use both the error messages that you've currently added, plus the response from the subserver Too see what I mean by a dropdown, look at how extra information is shown when clicking the "Additional Options" dropdown on: I'm also cc:ing @jamaljsr here, as UI:s isn't my specialty 😅, so I'd like to get his approval if this sounds like a good idea before you actually implement it. Either way, I definitely think we should create a combination of both the current error messages and the remote mode, with lnd node running and unlocked, wrong password entered
If we create the "advanced error message view" I think think it's ok that you include the full error message here. Just for future reference, as it might be helpful for you to understand our error messages more easily, when you see long nested error messages like this, it's actually most often the last part of the error message that most accurate. In this case it's remote mode, with lnd node running but locked, correct password enteredYes, in cases like this it'd make sense to show the Finally, in cases like this, you should also hit the remote mode, with lnd node not running, correct password enteredIf we add the "advanced error message" view, I actually think it makes sense to show the full error messages for both This case actually shows a case where the "advanced error message" view will be very helpful for users, as I believe you'll hit the "noConnectionErr" for the main error message view, right? integrated mode, with lnd node running and unlocked, wrong password enteredSee the answer for "remote mode, with lnd node running and unlocked, wrong password entered" :). integrated mode, with lnd node running but locked, correct password enteredSee the answer for "remote mode, with lnd node running but locked, correct password entered". integrated mode, lnd not runningThis will lead to the Let me know if something is still unclear! |
@ViktorTigerstrom thanks for all of this great feedback. There's really not much to add. I agree that the status message should be shown alongside the custom RPC error. The status error just provides more context into what may be causing the login to fail. Another approach for placement of the status message is to use an icon with a tooltip on hover. |
@ViktorTigerstrom and @jamaljsr, I have pushed a new commit to this branch and it works for me in all of the above cases. The css styles and error message text can easily be modified if necessary. I did notice, during my final testing, that I was getting some "unable to fetch subserver status" error messages. I don't know if these messages are specific to my setup, because I am not using any of the other subservers, or if they are caused by something else. One of them said it could not find lit.macaroon, which is an error I thought I had seen in the past. None of the code I changed should affect the way subserver statuses are retrieved, so I am assuming the messages I am seeing are a normal condition. But we should make sure that, in addition to displaying accurate error messages, all functionality still works after a successful login, and that is hard for me to do because I am currently testing this login code on an unfunded node with no channels. Specifically, the messages I am talking about are the red boxes that appear on the right side of the screen immediately after a successful login. I see several of them and most of them say "unable to fetch subserver status" but they disappear faster than I can read all of them. |
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.
Review
Thanks for the PR updates. Overall, the functionality works great. 🚀
I just have some cosmetic suggestions on the UI and code.
-
When I enter an incorrect password, it shows the "More Details" toggle but no additional message is displayed when I click on it. If there is no more details then I'd suggest hiding the toggle.
-
When the detailed message is long, expands the width of the red error box so it's no longer aligned to the input and doesn't look too good. I'd suggest setting a fixed width to prevent this and let the words wrap. Also, the "LiT" word is duplicated. I'd drop the "LiT:" prefix.
I made the suggested changes. I wasn't able to reproduce the empty detail message when an incorrect password is entered, but I put a check in place to prevent the button from being displayed if both detail messages are empty. However, at least one of them should contain text if there is an error. Also, I removed the redundant prefixes |
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.
Thanks for the updates. Everything is looking good now. I just have one more minor suggestion then this can be approved.
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.
tACK LGTM 👌
Great work on this PR. Thank you for the contribution.
This PR is related to Issue 655.
When the user is logging into the web interface, an exception is caught if the login fails.
However, the exception message is ignored and the "incorrect password" error message is displayed to the user in all cases.
The result is that, unless the user really did enter the wrong password, the error message will be incorrect.
This error can be caused by attempting to connect to a node that is not running or is in the locked state. Even if the correct password is entered, the error message says it is incorrect. These conditions can be identified more accurately than they currently are and should be reported to the user more accurately as well.
This PR will add a error detail message for both LiT and LND, which can be toggled. So there will now be as many as three error message: a main error message (always displayed) and LiT and LND detail error messages, at least one of which will be displayed.
The login error messages will be determined as follows:
If the subserver statuses could not be obtained, it will report a connection failure with detail in the LiT detail message.
If none of the above conditions are met, but the login still failed, it will do the following:
This will result in more accurate error messages being displayed on the web interface, which would make it easier for some users to diagnose login problems on their own. In cases where they still need assistance in diagnosing a problem, the more accurate error message will help to narrow down the cause earlier in the process.