Skip to content
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

Fix IOU request sent to new phone number account #3651

Merged
merged 5 commits into from
Jun 18, 2021

Conversation

Beamanator
Copy link
Contributor

Details

In Web-E, the debtorEmail param is using the $_WAFDEF['_EMAIL']; rule, which doesn't pass for phone numbers. Therefore, if we pass a basic phone number (ex: +17203334444) to a command using that param (ex: CreateIOUTransaction), debtorEmail will be wiped.

This is currently happening because when we merge personal details with the searchValue (in getPersonalDetailsForLogins), loginmay not have an SMS domain (for new accounts, there's nopersonalDetails` to merge, so we have to manually add the SMS domain there.

Video showing the issue:

Screen.Recording.2021-06-17.at.8.48.42.PM.mov

Fixed Issues

Fixes #3614

Tests

  1. Sign in to E.cash with existing account (or new one, doesn't matter)
  2. Click main green + button
  3. Click Request Money
  4. Enter a phone number (Note: an account with this phone number shouldn't already exist)
    • Don't add @expensify.sms at the end
  5. The IOU should be created successfully, without an infinite spinner

QA Steps

  1. Sign in to E.cash with existing account (or new one, doesn't matter)
  2. Click main green + button
  3. Click Request Money
  4. Enter a phone number (Note: an account with this phone number shouldn't already exist)
    • Don't add @expensify.sms at the end
  5. The IOU should be created successfully, without an infinite spinner

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Screen.Recording.2021-06-17.at.8.33.34.PM.mov

Mobile Web

Screen.Recording.2021-06-17.at.8.35.56.PM.mov

Desktop

Screen.Recording.2021-06-17.at.8.47.31.PM.mov

iOS

Screen.Recording.2021-06-17.at.8.38.34.PM.mov

Android

split-android.mov

@Beamanator Beamanator requested a review from a team June 17, 2021 18:50
@Beamanator Beamanator self-assigned this Jun 17, 2021
@MelvinBot MelvinBot requested review from francoisl and removed request for a team June 17, 2021 18:50
@Beamanator Beamanator requested a review from a team as a code owner June 17, 2021 18:54
@MelvinBot MelvinBot requested review from HorusGoul and removed request for a team June 17, 2021 18:55
@Beamanator
Copy link
Contributor Author

@HorusGoul looks like you got assigned by PullerBear when @francoisl was already assigned 🤷 feel free to unassign if you want, or add an extra review! 👍

Comment on lines +34 to +39
function addSMSDomainIfPhoneNumber(login) {
if (Str.isValidPhone(login) && !Str.isValidEmail(login)) {
return login + CONST.SMS.DOMAIN;
}
return login;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could go nicely in expensify-common, but I wanted to keep this in one PR since it's a deploy blocker

Comment on lines +35 to +38
if (Str.isValidPhone(login) && !Str.isValidEmail(login)) {
return login + CONST.SMS.DOMAIN;
}
return login;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might prefer to return early, but NAB

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even make it a ternary, but I'm not sure either is more legible than this. I'd say let's keep it like it is now.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Julesssss
Copy link
Contributor

Tests well for me. I saw the infinite spinner when entering an incorrect mobile number, so I'll create a new issue to handle the Invalid number response.

@Beamanator
Copy link
Contributor Author

I saw the infinite spinner when entering an incorrect mobile number, so I'll create a new issue to handle the Invalid number response.

Aah good point, I didn't worry too much about that b/c we shouldn't be able to create new users w/ invalid phone numbers after #3124

Comment on lines +35 to +38
if (Str.isValidPhone(login) && !Str.isValidEmail(login)) {
return login + CONST.SMS.DOMAIN;
}
return login;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even make it a ternary, but I'm not sure either is more legible than this. I'd say let's keep it like it is now.

@francoisl francoisl merged commit 54c082c into main Jun 18, 2021
@francoisl francoisl deleted the beaman-fix-iou-request-to-phone-num branch June 18, 2021 14:57
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging in version: 1.0.71-1🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.73-3🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request money - Endless loading spinner when requesting money from phone number account
4 participants