-
Notifications
You must be signed in to change notification settings - Fork 3k
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
IOU Invalid Phone number error handled #8019
IOU Invalid Phone number error handled #8019
Conversation
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.
@Santhosh-Sellavel Looks great, some minor formatting requests
Typo Co-authored-by: Rushat Gabhane <rushatgabhane@gmail.com>
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.
@iwiznia LGTM! 🎉
Commenting since I can't edit the PR PR Reviewer Checklist
|
@iwiznia @rushatgabhane bump! |
@Santhosh-Sellavel PR is already approved, let's merge |
@iwiznia @rushatgabhane updated with main brach |
Can you test the success case (successfully adding a phone number), add it to the list of tests and mark that checkbox please @Santhosh-Sellavel? |
Updated Tests @iwiznia. |
Awesome thanks! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@@ -179,8 +179,8 @@ Network.registerResponseHandler((queuedRequest, response) => { | |||
return; | |||
} | |||
|
|||
if (response.jsonCode === 405 || response.jsonCode === 404) { | |||
// IOU Split & Request money transactions failed due to invalid amount(405) or unable to split(404) | |||
if (response.jsonCode === 405 || response.jsonCode === 404 || response.jsonCode === 402) { |
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.
@Santhosh-Sellavel We must stop rejecting the promise here. ANY API command that returns this error code will lead to an unhandled promise rejection unless it is caught...
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.
Fixing it in this PR #8087 already but got conflicts because the bad practice continues 😅
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.
Sorry, I thought they were specific to this IOU Flow. Will keep a note on this @marcaaron.
@@ -66,6 +66,8 @@ function getIOUErrorMessage(error) { | |||
return Localize.translateLocal('common.error.invalidAmount'); | |||
} if (error.jsonCode === 404) { | |||
return Localize.translateLocal('iou.error.invalidSplit'); | |||
} if (error.jsonCode === 402) { |
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.
Put if
statements on new lines please
Is there a reason we don't validate phone numbers in the front-end? |
@roryabraham it'll require using some lib like google/libphonenumber. But it isn't really required because the backend already validates it for us. all details here - #7688 (comment) |
Details
Fixed Issues
$ #7688
Tests
Please enter a valid phone number, with the country code (e.g. +1234567890)
Success case:
PR Review Checklist
Contributor (PR Author) Checklist
main
### Fixed Issues
section abovesrc/languages/*
files (if applicable)Styling.md
) for all style edits I madeSTYLE.md
)Avatar
, I verified the components usingAvatar
are working as expected)main
branch)PR Reviewer Checklist
main
### Fixed Issues
section abovesrc/languages/*
files (if applicable)STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)main
branch)QA Steps
Please enter a valid phone number, with the country code (e.g. +1234567890)
Success case:
Screenshots
Web
IOU_Error_Web.mov
Mobile Web
IOU_Error_mWeb.mp4
Desktop
IOU_Error_Desktop.mov
iOS
IOU_Error_iOS.mp4
Android
IOU_Error_Android.mov