Skip to content

[$1000] Web - Show error when numbers entered in debit card holder name field #23175

Closed

Description

@kbecciv

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


Action Performed:

  1. Go to payments > debit card
  2. Enter a numeric string in name's place eg: 111111
  3. Fill the remaining details and hit enter

Expected Result:

There should be an error on name field

Actual Result:

No error on name field, 111111 passes the form validation

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.32-5
Reproducible in staging?: y
Reproducible in production?: y
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

bandicam.2023-07-08.16-43-41-823.mp4

Expensify/Expensify Issue URL:
Issue reported by: https://expensify.slack.com/archives/C049HHMV9SM/p1688813568570969
Slack conversation: @chiragxarora

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016cce6a5c4931cb3b
  • Upwork Job ID: 1683521297890430976
  • 2023-07-24
  • Automatic offers:
    • | | 0
    • chiragxarora | Contributor | 25763253

Activity

  1. added
    Daily
    Bug
    on Jul 19, 2023
  2. melvin-bot commented on Jul 19, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jul 19, 2023

    @melvin-bot

    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
  4. kbecciv commented on Jul 19, 2023

    @kbecciv
    Author

    Proposal

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

    Wrong validation for debit card holder name

    What is the root cause of that problem?

    Root cause of the issue is the current regex which we are using to validate the debit card's name. The regex is defined in the CONST.js file here

    App/src/CONST.js

    Line 1121 in c0ece67

    ALPHABETIC_CHARS_WITH_NUMBER: /^[a-zA-ZÀ-ÿ0-9 ]*$/,

    And we are using it here

    if (!values.nameOnCard || !ValidationUtils.isValidLegalName(values.nameOnCard)) {
    errors.nameOnCard = 'addDebitCardPage.error.invalidName';
    }

    This regex will match true for partial numerals and all numerals both. That is why legal names like 11111111, steve123 are shown as valid.

    Moreover this does not have and length limit either

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

    We shall introduce a new regex for debit card names which will match only alpha numeric with atleast one character and we can define it like this

    VALID_DEBIT_CARD_NAME: ^(?=.*[a-zA-ZÀ-ÿ])[a-zA-ZÀ-ÿ0-9 ]

    And we can add a length condition using quantifiers too

    VALID_DEBIT_CARD_NAME: ^(?=.*[a-zA-ZÀ-ÿ])[a-zA-ZÀ-ÿ0-9 ]{a,b}$

    The above expression will match alphanumeric strings with atleast one character and with length between a and b

    This will reject the invalid names which contain all numbers

    Along with this, we need to modify the current error message too as per our required characterset

    Results

    What alternative solutions did you explore? (Optional)

    We can also change the regex for legal name and use it for both legal name and debit card name

    We could further modify the regex if desired results change

    • we can choose all alphabets instead of alpha numeric
    • we can omit latin characters
  5. changed the title [-]Web - Wrong validation for debit card holder name[/-] [+]Web - Show error when numbers entered in debit card holder name field[/+] on Jul 24, 2023
  6. added
    External
    on Jul 24, 2023
  7. changed the title [-]Web - Show error when numbers entered in debit card holder name field[/-] [+][$1000] Web - Show error when numbers entered in debit card holder name field[/+] on Jul 24, 2023
  8. melvin-bot commented on Jul 24, 2023

    @melvin-bot
  9. added
    Help Wanted
    on Jul 24, 2023
  10. melvin-bot commented on Jul 24, 2023

    @melvin-bot

    Current assignee @sonialiap is eligible for the External assigner, not assigning anyone new.

  11. melvin-bot commented on Jul 24, 2023

    @melvin-bot

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

  12. 36 remaining items

  13. melvin-bot commented on Aug 3, 2023

    @melvin-bot

    @robertjchen, @sonialiap, @rushatgabhane, @chiragxarora Whoops! This issue is 2 days overdue. Let's get this updated quick!

  14. melvin-bot commented on Aug 7, 2023

    @melvin-bot

    @robertjchen, @sonialiap, @rushatgabhane, @chiragxarora 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  15. robertjchen commented on Aug 9, 2023

    @robertjchen
    Contributor

    Looks like this went out on production, what are the next steps here?

  16. chiragxarora commented on Aug 15, 2023

    @chiragxarora
    Contributor

    I believe this is ready for payment @sonialiap

  17. chiragxarora commented on Aug 15, 2023

    @chiragxarora
    Contributor

    not sure why the automation hasn't worked, I dont see the correct title to the GH here

  18. chiragxarora commented on Aug 17, 2023

    @chiragxarora
    Contributor

    Also, this qualifies for time bonus too @sonialiap

  19. melvin-bot commented on Aug 24, 2023

    @melvin-bot

    @robertjchen, @sonialiap, @rushatgabhane, @chiragxarora Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  20. chiragxarora commented on Aug 25, 2023

    @chiragxarora
    Contributor
  21. sonialiap commented on Aug 25, 2023

    @sonialiap
    Contributor

    Sorry for the delay, just got back from OOO, working through the payments now!

  22. sonialiap commented on Aug 25, 2023

    @sonialiap
    Contributor

    Payments:

    • time bonus applies because C+ approval was within 3 days of PR creation. The merge delay was on Expensify's end
    • @chiragxarora report + fix + bonus $1750 (paid in upwork)
    • @rushatgabhane review + bonus $1500 (please request in newdot)
  23. chiragxarora commented on Aug 25, 2023

    @chiragxarora
    Contributor

    This qualifies for time bonus too @sonialiap

  24. sonialiap commented on Aug 25, 2023

    @sonialiap
    Contributor

    I agree, time bonus is applicable because the merge delay was on our end, the C+ approval was within 3 business days
    I've updated my comment to show correct numbers

    @chiragxarora offer sent for the bonus
    @rushatgabhane please request $1500 for this issue

  25. rushatgabhane commented on Sep 5, 2023

    @rushatgabhane
    Member
  26. JmillsExpensify commented on Oct 5, 2023

    @JmillsExpensify
    Contributor

    $1,500 payment approved for @rushatgabhane based on BZ summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyExternalReviewing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions