-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Use more user friendly errors when choosing default fund for Wallet #7929
Conversation
src/languages/es.js
Outdated
noAccountToLink: 'Something went wrong. Please, contact Concierge.', | ||
invalidWallet: 'Your Wallet is currently suspended. Reach out to Concierge for help.', | ||
notOwnerOfBankAccount: 'We couldn\'t link this bank account to your Wallet. Please, reach out to Concierge for help.', | ||
invalidBankAccount: 'This bank account is temporarily suspended. Reach out to Concierge for help.', | ||
notOwnerOfFund: 'We couldn\'t link this fund to your Wallet. Reach out to Concierge for help.', | ||
invalidFund: 'This fund is temporarily suspended. Reach out to Concierge for help.', |
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.
Waiting for translations.
Sorry @mountiny I just caught up to this issue after OOO. We do not mention the word "Wallet" in product anywhere, so can we update the error message copy to avoid doing so? Also, what is a "fund"? I don't know what that means or how to fix it, so I think that will be confusing to users. Here are my suggestions for the first 4 (will propose something for the last two once I know what "fund" means):
|
@kevinksullivan Oh, thank you for heads up, I think these should still be in beta so users should not see it, but better safe than sorry. cc @rosegrech as you helped with the translations. I think funds are related to cards in this case, but I am not sure if it can be more things. There are VBAs and cards which can be used to top up the Wallet, right? @madmax330 should be able to shed more light on this too, thank you 🙇 |
Ahh got it ok, yeah those are likely debit cards then. I updated the table to incorporate suggestions for those as well. Basically I suggest we:
|
Sounds good to me, I will just wait for @rosegrech if she has anything to add here as she has helped with the original copy (but I suggested the Wallet and Suspended terms 😅 ) Gonna update the Spanish translation to HOLD |
Thanks @kevinksullivan for jumping in. I did not realize about avoiding "wallet" so I updated our SO on copy. Two quick overall things to note @vitHoracek
|
Asked for translations in Slack. Thank you very much for your help on this! |
I have updated the copy based on the discussion led here. For errors and notifications, we are trying to have a passive form. I have also reduced the number of messages as they have overlapped so now there are 3 messages and one deafult. |
Is this still WIP? |
Still WIP, waiting for the Spanish translations as they were discussing more broadly what patterns to use in NewDot. |
src/libs/actions/PaymentMethods.js
Outdated
switch (error.message) { | ||
case CONST.WALLET.ERROR.INVALID_WALLET: | ||
case CONST.WALLET.ERROR.NOT_OWNER_OF_BANK_ACCOUNT: | ||
Growl.show(Localize.translateLocal('paymentsPage.error.notOwnerOfBankAccount') + " " + Localize.translateLocal('common.conciergeHelp'), CONST.GROWL.ERROR, 5000); |
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.
As per Ionatan suggestion, I have put the general Please contact Concierge
message to separate translation so it can be reused. I have concatenated the two messages like this but I am not sure if there is a preference over doing this or using the `${foo} ${bar}` way.
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.
Alright, linter has answered this for me by throwing an error :)
@stitesExpensify @madmax330 This is now finally ready for a review! Thank you very much 🙇 |
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.
LGTM!
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.
LGTM, do we have to do all the steps mentioned in the OP or is that for contributor PRs?
No, I don't think that is necessary in this case. Also, it does not influence UI really so we should be good. Thank you very much for your reviews! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Growl.show(`${Localize.translateLocal('paymentsPage.error.invalidBankAccount')} ${Localize.translateLocal('common.conciergeHelp')}`, CONST.GROWL.ERROR, 5000); | ||
return; | ||
default: | ||
Growl.show(Localize.translateLocal('paymentsPage.error.setDefaultFailure'), CONST.GROWL.ERROR, 5000); |
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.
Anyone know if it's possible for this API command promise method to land in this .catch()
block?
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.
What exception is thrown and where?
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.
Oh I think it's this weird code here that I am removing 😄
Lines 182 to 187 in c26e415
if (response.jsonCode === 405 || response.jsonCode === 404) { | |
// IOU Split & Request money transactions failed due to invalid amount(405) or unable to split(404) | |
// It's a failure, so reject the queued request | |
queuedRequest.reject(response); | |
return; | |
} |
I think most errors do not work this way and catch()
should never do anything. No worries though just in the process of cleaning some stuff up.
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.
There is this one which we decided not to catch specifically as it should not happen but if it happens, the error message would need to be very general as the default already was.
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.
Yes thanks I would like to know where the exception gets thrown in the JavaScript layer.
This issue has more details: https://github.com/Expensify/Expensify/issues/201109
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.
Oh interesting, I have first tried to handle it in the then
case but it did not work for me, catch
did. Not sure now why that is happening. Catch worked locally.
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.
Ah, thanks for the context! 🙌
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.
Yeah it's because the promise is getting rejected which will trigger the .catch()
block and would be similar to throwing an exception inside the .then()
block. Kind of weird IMO because who knows how many API can throw these codes (or which may throw them in the future) and any that are not handled like you did here will crash the app.
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.
Oh, that is weird indeed. We should standardize this for sure.
@mountiny We also experienced with App freezes when tried to set payment as default. Image.from.iOS.6.MP4 |
@mountiny Issue appears in production as well. Image.from.iOS.10.MP4 |
Thank you, I have reopened the linked issue! |
🚀 Deployed to production by @chiragsalian in version: 1.1.42-6 🚀
|
Related to https://github.com/Expensify/Web-Expensify/pull/33132
And related to small backend change where I emphasize the error messages need to be updated in frontend too if changed in backend https://github.com/Expensify/Auth/pull/6477
Details
We have only been showing a generic error when setting a default fund for Expensify Wallet has failed. This change handles all the possible error and gives the user better feedback when it fails. Unfortunately, for most of these errors the users cannot do much on their own, but knowing the specific error message can help the support to identify the next steps to fix it.
Fixed Issues
$ #7521
Tests
To test all the specific errors would be hard. We can leave this for Applause as they reported this problem and we are only making the error messages a bit more helpful.
Prerequisite: Set the VBA in testing account (But make sure it is not in OPEN state)
PR Review Checklist
Contributor (PR Author) Checklist
main
before submitting my PR for review### Fixed Issues
section abovesrc/languages/*
files (if applicable)Styling.md
) for all style edits I madePR Reviewer Checklist
main
before submitting the PR### Fixed Issues
section abovesrc/languages/*
files (if applicable)QA Steps
Prerequisite: Set the VBA in testing account
Tested On
Screenshots
Web
since this is only API error handling change, I have not tested it on all platforms as there is not expectation of change.