App icon indicating copy to clipboard operation
App copied to clipboard

[$500] Bank account – Able to save a phone number with some spaces before and without +

Open lanitochka17 opened this issue 1 year ago • 6 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 1.4.38-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4289031 Email or phone of affected tester (no customers): [email protected] Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:

Action Performed:

  1. Open New Expensify app.
  2. Log in with a applause.expensifail account (that does not have any bank account already added)
  3. Navigate to the add bank account modal
  4. Select the Manual method to add a bank account
  5. On the "Connect Bank Account" page, enter the routing and account numbers
  6. Checkmark the "I accept the Expensify Terms of Service"
  7. In the company information
  8. Fill out the company information
  9. Fill out the phone number information with some spaces before and without +
  10. Click Save and continue

Expected Result:

You’re shown an error on the incorporation date field

Actual Result:

Able to save a phone number with some spaces before and without +

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • [x] Android: Native
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [ ] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/32d3f07d-d1d1-4ca3-b568-9c9ba597c5a6

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019136df945e25456b
  • Upwork Job ID: 1755331054635565056
  • Last Price Increase: 2024-02-07

lanitochka17 avatar Feb 07 '24 20:02 lanitochka17

Job added to Upwork: https://www.upwork.com/jobs/~019136df945e25456b

melvin-bot[bot] avatar Feb 07 '24 20:02 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (External)

melvin-bot[bot] avatar Feb 07 '24 20:02 melvin-bot[bot]

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

melvin-bot[bot] avatar Feb 07 '24 20:02 melvin-bot[bot]

How to make applause.expensifail account for new contributors?

godofoutcasts94 avatar Feb 07 '24 20:02 godofoutcasts94

This is intentional. It presumes that the phone is US phone so it works without giving it the country code.

FitseTLT avatar Feb 07 '24 20:02 FitseTLT

Input without country code is alright, it is handled in the validation function but we need to fix the extra white spaces issue

Proposal

Please re-state the problem that we are trying to solve in this issue.

Able to save a phone number with some spaces before

What is the root cause of that problem?

In isValidUSPhone , we do not check if there are white spaces in the input

https://github.com/Expensify/App/blob/e2b670428a07919c8a37d3f3c8cf1963ffd0297a/src/libs/ValidationUtils.ts#L266

What changes do you think we should make in order to solve the problem?

have a condition in isValidUSPhone function such that if there are any white spaces at the starting or ending of the phone number then return false:


// Check for extra spaces
    if (phoneNumber !== phoneNumber.trim()) {
        return false; // Extra spaces found, return false
    }

This will display error message to enter valid phone number

What alternative solutions did you explore? (Optional)

N/A

allgandalf avatar Feb 07 '24 21:02 allgandalf

@cubuspl42, @johncschuster Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Feb 13 '24 15:02 melvin-bot[bot]

@GandalfGwaihir How does your solution improve the UX? Does it change some glitch for a form validation error, or does the old code just trim the extra whitespace without any user-observable issues?

cubuspl42 avatar Feb 14 '24 10:02 cubuspl42

@cubuspl42 , yes my solution does improve the UX.

Currently we allow the inputs with whitespaces like 997567 , but this shouldn’t be allowed as we need to store the values in form 997567, this is a phone number so proper formated values need to be sent to the backend :)

Does it change some glitch for a form validation error

yes we currently miss this validation error i.e. we don’t return false for is valid phone number when we have whitespaces in the input ,

The old code doesn’t do any such type of validation , it simply passed the input value to isValidUSPhone

allgandalf avatar Feb 14 '24 11:02 allgandalf

The issue (or the proposal) don't show any evidence of how a number like 997567 is actually presented to the user (as opposed as just being accepted during input). Could you provide some before/after screenshots?

cubuspl42 avatar Feb 14 '24 11:02 cubuspl42

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

melvin-bot[bot] avatar Feb 14 '24 16:02 melvin-bot[bot]

~~Hey @cubuspl42 , The Bank account setup was upgraded to new UI and they have removed the Phone number field it seems, you can close this issue for good :)~~

Please wait for updated comments;

EDIT: We send the untrimmed value to the BE as we include whitespaces in the input, so answering your question: Yes this my solution does fix the bug in form validation as it will give error to the input in phone number where we have whitespaces either at the beginning or at the end of the input :)

https://github.com/Expensify/App/assets/110545952/84585c0b-1154-4940-8295-f3192b7ebbee

Expected Result: You’re shown an error on the incorporation date field

From the issue description they expect that we should not allow any spaces when saving a phone number, currently we allow it, but this should not be allowed according to the expected results of this bug

allgandalf avatar Feb 14 '24 20:02 allgandalf

hello @cubuspl42 , please refer to my new comments above

allgandalf avatar Feb 15 '24 16:02 allgandalf

In such a case, I disagree that we should raise an error. We should silently trim the number. It could be copy-pasted from a source, which adds the extra whitespace. It's possibly not the user's fault.

cubuspl42 avatar Feb 16 '24 09:02 cubuspl42

Well if that is the case then we can go that way too, :) no worries

We would then send trimmed inputs to the validation function

allgandalf avatar Feb 16 '24 09:02 allgandalf

What are the up-to-date reproduction steps? Is there a way to get to this point without going through Onfido flow?

cubuspl42 avatar Feb 16 '24 10:02 cubuspl42

We need to start connecting the bank account manually, then at the summary page as seen in the video i had attached, we can reproduce this bug

Is there a way to get to this point without going through Onfido flow?

Not really we have to follow the Onfido flow

allgandalf avatar Feb 16 '24 10:02 allgandalf

It was tough, but I reproduced the issue, skipping the Onfido flow. See this Slack thread.

I confirm that we present the whitespace-containing telephone number to the user in the confirmation step.

It's a minor thing, but it is a bug indeed.

I approve the proposal by @GandalfGwaihir

C+ reviewed 🎀 👀 🎀

cubuspl42 avatar Feb 19 '24 12:02 cubuspl42

Triggered auto assignment to @nkuoch, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Feb 19 '24 12:02 melvin-bot[bot]

📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Feb 19 '24 14:02 melvin-bot[bot]

📣 @GandalfGwaihir You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻 Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing 📖

melvin-bot[bot] avatar Feb 19 '24 14:02 melvin-bot[bot]

PR will be ready by Wednesday :)

allgandalf avatar Feb 19 '24 19:02 allgandalf

PR up for review @cubuspl42 :)

allgandalf avatar Feb 20 '24 22:02 allgandalf

This issue has not been updated in over 15 days. @nkuoch, @cubuspl42, @johncschuster, @GandalfGwaihir eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

melvin-bot[bot] avatar Mar 15 '24 19:03 melvin-bot[bot]

PR is merged

cubuspl42 avatar Mar 18 '24 09:03 cubuspl42

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] avatar Mar 18 '24 16:03 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.53-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/36961

If no regressions arise, payment will be issued on 2024-03-25. :confetti_ball:

For reference, here are some details about the assignees on this issue:

  • @cubuspl42 requires payment automatic offer (Reviewer)
  • @GandalfGwaihir requires payment (Needs manual offer from BZ)

melvin-bot[bot] avatar Mar 18 '24 16:03 melvin-bot[bot]

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [ ] [@cubuspl42] The PR that introduced the bug has been identified. Link to the PR:
  • [ ] [@cubuspl42] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [ ] [@cubuspl42] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [ ] [@cubuspl42] Determine if we should create a regression test for this bug.
  • [ ] [@cubuspl42] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [ ] [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

melvin-bot[bot] avatar Mar 18 '24 16:03 melvin-bot[bot]

Bumping to keep Melvin happy. I will issue payment on March 25 👍

johncschuster avatar Mar 20 '24 20:03 johncschuster

friendly bump @johncschuster for payment :)

allgandalf avatar Mar 26 '24 23:03 allgandalf