App
App copied to clipboard
[$500] Bank account – Able to save a phone number with some spaces before and without +
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:
- Open New Expensify app.
- Log in with a applause.expensifail account (that does not have any bank account already added)
- Navigate to the add bank account modal
- Select the Manual method to add a bank account
- On the "Connect Bank Account" page, enter the routing and account numbers
- Checkmark the "I accept the Expensify Terms of Service"
- In the company information
- Fill out the company information
- Fill out the phone number information with some spaces before and without +
- 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
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~019136df945e25456b
- Upwork Job ID: 1755331054635565056
- Last Price Increase: 2024-02-07
Job added to Upwork: https://www.upwork.com/jobs/~019136df945e25456b
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (External
)
Triggered auto assignment to @johncschuster (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
How to make applause.expensifail account for new contributors?
This is intentional. It presumes that the phone is US phone so it works without giving it the country code.
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
@cubuspl42, @johncschuster Huh... This is 4 days overdue. Who can take care of this?
@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 , 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
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?
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
~~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
hello @cubuspl42 , please refer to my new comments above
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.
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
What are the up-to-date reproduction steps? Is there a way to get to this point without going through Onfido flow?
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
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 🎀 👀 🎀
Triggered auto assignment to @nkuoch, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
📣 @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 📖
PR will be ready by Wednesday :)
PR up for review @cubuspl42 :)
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!
PR is merged
Reviewing
label has been removed, please complete the "BugZero Checklist".
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)
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:
Bumping to keep Melvin happy. I will issue payment on March 25 👍
friendly bump @johncschuster for payment :)