Skip to content

[HOLD for payment 2023-07-12] [$1000] emojis are accepted in card name, debit card form field. #21255

Closed

Description

@kavimuru

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 settings -> payments -> add debit card
  2. Enter name with emojis on card name form field.
    for eg : " John ❤️😄😄" .
  3. Notice it doesn't throw any error.

Expected Result:

inconsistecny in "Legal Name" and "Card Name" form field.
i.e in legal name emojis and special characters aren't allowed. whereas card name form field doesn't check emojis.

Actual Result:

Emojis are allowed in card name field.

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.30-0
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
Screenshot 2023-06-15 at 4 35 23 PM

Screen.Recording.2023-06-15.at.4.39.24.PM.mov
Recording.1052.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016b95ce0b884de115
  • Upwork Job ID: 1671871155122483200
  • Last Price Increase: 2023-06-22

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 21, 2023
  2. melvin-bot commented on Jun 21, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jun 21, 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. Ollyws commented on Jun 21, 2023

    @Ollyws
    Contributor

    Proposal

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

    Emojis are accepted for card name.

    What is the root cause of that problem?

    The ALPHABETIC_CHARS regex isn't using any anchors, but in ALPHABETIC_CHARS_WITH_NUMBER we do use the anchors ^ and $.

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

    Modify ALPHABETIC_CHARS to have anchors (and also a space and accented characters), eg: ALPHABETIC_CHARS: /^[a-zA-ZÀ-ÿ ]*$/,
    This way it matches ALPHABETIC_CHARS_WITH_NUMBER, but without numbers.

    What alternative solutions did you explore? (Optional)

    None

  5. Nikhil-Vats commented on Jun 21, 2023

    @Nikhil-Vats
    Contributor

    Proposal

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

    Emojis are accepted for card name in AddDebitCardPage.

    What is the root cause of that problem?

    We have two different functions for validating legal name and card name.

    function isValidCardName(nameOnCard) {
    if (!CONST.REGEX.ALPHABETIC_CHARS.test(nameOnCard)) {
    return false;
    }
    return !_.isEmpty(nameOnCard.trim());
    }

    function isValidLegalName(name) {
    return CONST.REGEX.ALPHABETIC_CHARS_WITH_NUMBER.test(name);
    }

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

    We should remove one of the functions and use the other function in both places -

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

    We should remove isValidCardName as ALPHABETIC_CHARS is a wrong regex and allows emoji etc. Moreover, we should rename isValidLegalName to isValidName to make it generic and usable in multiple places.

    We should also remove ALPHABETIC_CHARS as it is wrong and not used at any other place.

    What alternative solutions did you explore? (Optional)

    NA

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 22, 2023
  7. changed the title [-]emojis are accepted in card name, debit card form field.[/-] [+][$1000] emojis are accepted in card name, debit card form field.[/+] on Jun 22, 2023
  8. melvin-bot commented on Jun 22, 2023

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 22, 2023
  10. melvin-bot commented on Jun 22, 2023

    @melvin-bot

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

  11. melvin-bot commented on Jun 22, 2023

    @melvin-bot

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

  12. Nodebrute commented on Jun 23, 2023

    @Nodebrute
    Contributor

    Proposal

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

    emojis are accepted in card name, debit card form field

    What is the root cause of that problem?

    The regex for Card Name is not checking for errors.

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

    we should throw an error whenever the user enters an emoji in the input field. To achieve this we can add an emoji check where we are validating. We already have an emojis regex in CONST.js we can use it to validate Bank name input field

    here add another check || CONST.REGEX.EMOJIS.test(nameOnCard)

    In this way we are not messing up with already created regex. We can also add this check in address field that is also accepting emojis

    Results

    Screen.Recording.2023-06-24.at.12.19.23.AM.mov

    What alternative solutions did you explore? (Optional)

  13. 35 remaining items

  14. PauloGasparSv commented on Jul 12, 2023

    @PauloGasparSv
    Contributor
  15. narefyev91 commented on Jul 12, 2023

    @narefyev91
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: validate value in "Name on card" field #6845
    • 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 - https://github.com/Expensify/App/pull/6845/files#r1261199765
    • 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 - no discussions
    • Determine if we should create a regression test for this bug - we are good with QA steps in current issue
  16. trjExpensify commented on Jul 12, 2023

    @trjExpensify
    Contributor

    👋 @narefyev91

    The PR that introduced the bug has been identified. Link to the PR: #21880
    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 - no comments were addressed

    That wasn't the PR that introduced the bug was it? 😕

  17. Nikhil-Vats commented on Jul 12, 2023

    @Nikhil-Vats
    Contributor

    @narefyev91 @trjExpensify this is the PR that introduced the bug.

  18. narefyev91 commented on Jul 12, 2023

    @narefyev91
    Contributor

    Yup already linked that #6845

  19. trjExpensify commented on Jul 12, 2023

    @trjExpensify
    Contributor

    Okay cool, and did you comment on the PR for the benefit of its authors to close the feedback loop?

  20. trjExpensify commented on Jul 12, 2023

    @trjExpensify
    Contributor

    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 - no discussions

    On this one, I actually wonder if there's something we could be doing better to ensure emojis don't slip through the net on fields that have input restrictions. Did you consider that, such that we can potentially limit this type of bug report in the future perhaps?

    Determine if we should create a regression test for this bug - we are good with QA steps in current issue

    As for this, I think we can modify the existing test script to accommodate a check for the name field in addition. I've gone ahead and created an issue for Applause for that edit.

    Error tests and add second debit card

    1. Navigate to the add debit card page
    2. Without entering any data, click on the save button
    3. Verify all the required fields show an error informing the user of the required information
    4. Verify all errors are related to the missing info
    5. On the Name field - enter an invalid name (e.g John 😄 ❤️ )
    6. Verify there's an error indicating that the name can only include latin letters and numbers.
    7. On the Expiration date - enter a invalid date (e.g 1111)
    8. Verify there's an error indicating the user to enter a valid date
    9. Fill each field with random valid data
    10. Verify the errors are removed after entering valid data on each field
    11. Verify the error above the "Save" button is removed after fixing each field
    12. Add a secondary debit card - For the debit card number, use any from this list Sandbox Cards
  21. isabelastisser commented on Jul 12, 2023

    @isabelastisser
    Contributor

    Offers sent in Upwork to @Nikhil-Vats and @ashimsharma10, please accept it and I will send the payment.

    @narefyev91 I can't find you in Upwork, what's your profile?

  22. narefyev91 commented on Jul 12, 2023

    @narefyev91
    Contributor

    Offers sent in Upwork to @Nikhil-Vats and @ashimsharma10, please accept it and I will send the payment.

    @narefyev91 I can't find you in Upwork, what's your profile?

    @isabelastisser no worries - I'm from Callstack - and no needs to pay inside Upwork

  23. Nikhil-Vats commented on Jul 12, 2023

    @Nikhil-Vats
    Contributor

    @isabelastisser offer accepted.

  24. isabelastisser commented on Jul 12, 2023

    @isabelastisser
    Contributor

    The payments are processed in Upwork, we should be all set!

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions