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

[HOLD for payment 2023-06-30] Bank-account - The emply account number have 'The routing number and account number cannot be the same' instead of 'Please enter a valid routing number' #21222

Closed
5 of 6 tasks
lanitochka17 opened this issue Jun 21, 2023 · 20 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@lanitochka17
Copy link

lanitochka17 commented Jun 21, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Issue found when executing PR #20560

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Create a workspace
  3. Go to Workspace > Travel > Connect bank account > Connect manually
  4. Enter 074000078 as routing number and account number
  5. Check the terms checkbox
  6. Tap Back button
  7. Clear account number, followed by routing number

Expected Result:

The empty account number field should be 'Please enter a valid routing number' instead of 'The routing number and account number cannot be the same'

Actual Result:

The empty account number field is 'Please enter a valid routing number' at first, until the routing number is cleared and it becomes 'The routing number and account number cannot be the same'

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.30.0

Reproducible in staging?: Yes

Reproducible in production?: No

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Bug6101477_Screenshot_20230621_221143

Bug6101477_Screen_Recording_20230621_221052_Chrome.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Jun 21, 2023
@OSBotify
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Jun 21, 2023

Triggered auto assignment to @chiragsalian (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@Nikhil-Vats
Copy link
Contributor

Nikhil-Vats commented Jun 21, 2023

Proposal

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

Wrong error when same account number and route number are entered and then removed.

What is the root cause of that problem?

Here we don't check if account number/route number is empty.

if (values.accountNumber === routingNumber) {
errorFields.accountNumber = this.props.translate('bankAccount.error.routingAndAccountNumberCannotBeSame');
}

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

We should change the condition above to -

if (values.accountNumber && values.accountNumber === routingNumber)

so that only if values.accountNumber is not empty we show the error of same account number and routing number.

What alternative solutions did you explore? (Optional)

Alternatively, we can also use !_.isEmpty(values.accountNumber) instead of values.accountNumber.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Hourly KSv2 labels Jun 21, 2023
@Pujan92
Copy link
Contributor

Pujan92 commented Jun 21, 2023

Proposal

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

Bank-account - The emply account number have 'The routing number and account number cannot be the same' instead of 'Please enter a valid routing number'

What is the root cause of that problem?

For the same field, we have 2 different if conditions separately with which 2nd truthy condition updates/overwrites the previous errorField accountNumber.

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

For the same field we can convert the same number condition to else if(which makes sure only one error can be applied at a time for same field), so it will only validate the same number condition when accountNumber is provided.

if (
!values.accountNumber ||
(!CONST.BANK_ACCOUNT.REGEX.US_ACCOUNT_NUMBER.test(values.accountNumber.trim()) && !CONST.BANK_ACCOUNT.REGEX.MASKED_US_ACCOUNT_NUMBER.test(values.accountNumber.trim()))
) {
errorFields.accountNumber = 'bankAccount.error.accountNumber';
}
if (!routingNumber || !CONST.BANK_ACCOUNT.REGEX.SWIFT_BIC.test(routingNumber) || !ValidationUtils.isValidRoutingNumber(routingNumber)) {
errorFields.routingNumber = 'bankAccount.error.routingNumber';
}
if (values.accountNumber === routingNumber) {
errorFields.accountNumber = this.props.translate('bankAccount.error.routingAndAccountNumberCannotBeSame');
}

       if (
            !values.accountNumber ||
            (!CONST.BANK_ACCOUNT.REGEX.US_ACCOUNT_NUMBER.test(values.accountNumber.trim()) && !CONST.BANK_ACCOUNT.REGEX.MASKED_US_ACCOUNT_NUMBER.test(values.accountNumber.trim()))
        ) {
            errorFields.accountNumber = 'bankAccount.error.accountNumber';
        } else if (values.accountNumber === routingNumber) {
            errorFields.accountNumber = this.props.translate('bankAccount.error.routingAndAccountNumberCannotBeSame');
        }
Result
Screen.Recording.2023-06-21.at.10.14.00.PM.mp4

@luacmartins luacmartins added Hourly KSv2 and removed Daily KSv2 labels Jun 21, 2023
@chiragsalian chiragsalian mentioned this issue Jun 21, 2023
57 tasks
@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jun 21, 2023
@chiragsalian
Copy link
Contributor

chiragsalian commented Jun 21, 2023

Thank you for the proposals. I'm going ahead with @Nikhil-Vats solution since it makes sense to me. I've pushed up a PR for it since its required soon. Once accepted I'll ask around to figure out how payment should be handled.

Edit: I've used @Pujan92 solution

@Pujan92
Copy link
Contributor

Pujan92 commented Jun 21, 2023

@chiragsalian isn't it good to put the conditions with if/else-if for same keys to avoid overwriting the errors, I thought we already checking !values.accountNumber and setting error required for it then we can easily put else if without checking values.accountNumber again?

@chiragsalian
Copy link
Contributor

I'm not too concerned about avoiding overwriting the errors because both solutions prevents overwriting the errors. Although now I understand your solution better and I like it more since it DRYs up the code and makes it easier to read imo.

@luacmartins
Copy link
Contributor

Removing the blocker label since we merged/CPed the fix.

@luacmartins luacmartins added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Jun 21, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 22, 2023
@melvin-bot melvin-bot bot changed the title Bank-account - The emply account number have 'The routing number and account number cannot be the same' instead of 'Please enter a valid routing number' [HOLD for payment 2023-06-29] Bank-account - The emply account number have 'The routing number and account number cannot be the same' instead of 'Please enter a valid routing number' Jun 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

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

If no regressions arise, payment will be issued on 2023-06-29. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 23, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-06-29] Bank-account - The emply account number have 'The routing number and account number cannot be the same' instead of 'Please enter a valid routing number' [HOLD for payment 2023-06-30] [HOLD for payment 2023-06-29] Bank-account - The emply account number have 'The routing number and account number cannot be the same' instead of 'Please enter a valid routing number' Jun 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 23, 2023

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

If no regressions arise, payment will be issued on 2023-06-30. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Jun 28, 2023
@chiragsalian
Copy link
Contributor

Oops this slipped my radar. I thought someone was already assigned to help out here.
I've asked in slack if someone can handle the payment here.

@melvin-bot melvin-bot bot removed the Overdue label Jun 30, 2023
@chiragsalian chiragsalian added the Bug Something is broken. Auto assigns a BugZero manager. label Jun 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 30, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@chiragsalian
Copy link
Contributor

@kadiealexander can you help to pay @Pujan92 since i used his proposal.

@kadiealexander
Copy link
Contributor

How much am I paying, @chiragsalian?

@kadiealexander kadiealexander changed the title [HOLD for payment 2023-06-30] [HOLD for payment 2023-06-29] Bank-account - The emply account number have 'The routing number and account number cannot be the same' instead of 'Please enter a valid routing number' [HOLD for payment 2023-06-30] Bank-account - The emply account number have 'The routing number and account number cannot be the same' instead of 'Please enter a valid routing number' Jul 4, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 5, 2023
@chiragsalian
Copy link
Contributor

I'm not sure, i asked in #bug-zero on slack.

@melvin-bot melvin-bot bot removed the Overdue label Jul 5, 2023
@kadiealexander
Copy link
Contributor

Have issued a contract to @Pujan92, please let me know once you've accepted :)

@Pujan92
Copy link
Contributor

Pujan92 commented Jul 6, 2023

Thanks. @kadiealexander accepted.

@kadiealexander
Copy link
Contributor

Thanks @Pujan92, I've paid this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

7 participants