Skip to content

[Pay meow][$1000] Legal name - When tapping on the Legal Last Name field, the error message alternates between 'This field is required' and 'Name can only include Latin characters #31391

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!


Version Number:
Reproducible in staging?:
Reproducible in production?:
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
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in with any account
  3. Go to Setting - Profile - Personal details - Legal name
  4. Try invisible characters from this site https://invisible-characters.com/3164-HANGUL-FILLER.html
  5. Put it on both field
  6. Click Save
  7. Put cursor on legal first name than on Legal Last name

Expected Result:

When tapping on the Legal Last Name field, the error message shouldn't switch between 'This field is required' and 'Name can only include Latin characters

Actual Result:

When tapping on the Legal Last Name field, the error message alternates between 'This field is required' and 'Name can only include Latin characters

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Recording.5424.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01df7fd3e27a4b1629
  • Upwork Job ID: 1724836966037389312
  • Last Price Increase: 2023-11-29
  • Automatic offers:
    • shubham1206agra | Contributor | 27985228
    • bernhardoj | Contributor | 28072802

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 15, 2023
  2. changed the title [-]Legal name - When tapping on the Legal Last Name field, the error message shouldn't switch between 'This field is required' and 'Name can only include Latin characters[/-] [+][$500] Legal name - When tapping on the Legal Last Name field, the error message shouldn't switch between 'This field is required' and 'Name can only include Latin characters[/+] on Nov 15, 2023
  3. melvin-bot commented on Nov 15, 2023

    @melvin-bot
  4. melvin-bot commented on Nov 15, 2023

    @melvin-bot

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

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 15, 2023
  6. melvin-bot commented on Nov 15, 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
  7. melvin-bot commented on Nov 15, 2023

    @melvin-bot

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

  8. 5war00p commented on Nov 15, 2023

    @5war00p
    Contributor

    Proposal

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

    Switching between error messages when the message is empty in the legal name page

    What is the root cause of that problem?

    Chained if conditions causing this error message switch, instead we can have if-else if-else blocks only.

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

    if (!ValidationUtils.isValidLegalName(values.legalFirstName)) {
    ErrorUtils.addErrorMessage(errors, 'legalFirstName', 'privatePersonalDetails.error.hasInvalidCharacter');
    } else if (_.isEmpty(values.legalFirstName)) {
    errors.legalFirstName = 'common.error.fieldRequired';
    }
    if (values.legalFirstName.length > CONST.LEGAL_NAME.MAX_LENGTH) {
    ErrorUtils.addErrorMessage(errors, 'legalFirstName', ['common.error.characterLimitExceedCounter', {length: values.legalFirstName.length, limit: CONST.LEGAL_NAME.MAX_LENGTH}]);
    }
    if (!ValidationUtils.isValidLegalName(values.legalLastName)) {
    ErrorUtils.addErrorMessage(errors, 'legalLastName', 'privatePersonalDetails.error.hasInvalidCharacter');
    } else if (_.isEmpty(values.legalLastName)) {
    errors.legalLastName = 'common.error.fieldRequired';
    }
    if (values.legalLastName.length > CONST.LEGAL_NAME.MAX_LENGTH) {
    ErrorUtils.addErrorMessage(errors, 'legalLastName', ['common.error.characterLimitExceedCounter', {length: values.legalLastName.length, limit: CONST.LEGAL_NAME.MAX_LENGTH}]);
    }

    Change the above if conditions as the below code block to

           if (_.isEmpty(values.legalFirstName)) {
                errors.legalFirstName = 'common.error.fieldRequired';
            }
           else if (!ValidationUtils.isValidLegalName(values.legalFirstName)) {
                ErrorUtils.addErrorMessage(errors, 'legalFirstName', 'privatePersonalDetails.error.hasInvalidCharacter');
            } 
            else if (values.legalFirstName.length > CONST.LEGAL_NAME.MAX_LENGTH) {
                ErrorUtils.addErrorMessage(errors, 'legalFirstName', ['common.error.characterLimitExceedCounter', {length: values.legalFirstName.length, limit: CONST.LEGAL_NAME.MAX_LENGTH}]);
            }
            else if (!ValidationUtils.isValidLegalName(values.legalLastName)) {
                ErrorUtils.addErrorMessage(errors, 'legalLastName', 'privatePersonalDetails.error.hasInvalidCharacter');
            } else if (_.isEmpty(values.legalLastName)) {
                errors.legalLastName = 'common.error.fieldRequired';
            }
            else if (values.legalLastName.length > CONST.LEGAL_NAME.MAX_LENGTH) {
                ErrorUtils.addErrorMessage(errors, 'legalLastName', ['common.error.characterLimitExceedCounter', {length: values.legalLastName.length, limit: CONST.LEGAL_NAME.MAX_LENGTH}]);
            }
    

    What alternative solutions did you explore? (Optional)

    NA

  9. changed the title [-][$500] Legal name - When tapping on the Legal Last Name field, the error message shouldn't switch between 'This field is required' and 'Name can only include Latin characters[/-] [+][$500] Legal name - When tapping on the Legal Last Name field, the error message alternates between 'This field is required' and 'Name can only include Latin characters[/+] on Nov 15, 2023
  10. tienifr commented on Nov 15, 2023

    @tienifr
    Contributor

    Proposal

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

    Switching between error messages when the message is empty in the legal name page

    What is the root cause of that problem?

    We already trim value in

    const trimmedStringValues = ValidationUtils.prepareValues(values);

    but this line we did not use trimmedStringValues

    Beside, when submit we call onValidate with trimmedValue

    if (!_.isEmpty(onValidate(trimmedStringValues))) {

    But when blur we just use inputeValues

    onValidate(inputValues, !hasServerError);

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

    Use trimmedStringValues in here like we did in onSubmit

    Result

  11. mananjadhav commented on Nov 16, 2023

    @mananjadhav
    Collaborator

    When tapping on the Legal Last Name field, the error message shouldn't switch between 'This field is required' and 'Name can only include Latin characters

    @Christinadobrzyn I think before I choose any proposal we should clarify, which error should be shown exactly? The expected result doesn't mention this.

  12. 143 remaining items

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Jan 31, 2024
  14. changed the title [-][$1000] Legal name - When tapping on the Legal Last Name field, the error message alternates between 'This field is required' and 'Name can only include Latin characters[/-] [+][Pay meow][$1000] Legal name - When tapping on the Legal Last Name field, the error message alternates between 'This field is required' and 'Name can only include Latin characters[/+] on Jan 31, 2024
  15. mallenexpensify commented on Jan 31, 2024

    @mallenexpensify
    Contributor

    @Christinadobrzyn this issue didn't auto update, nor remove the Reviewing label. I updated, can you issue payment plz? PR hit production a few weeks ago.

  16. Christinadobrzyn commented on Jan 31, 2024

    @Christinadobrzyn
    Contributor

    sorry for the delay, paying out now

    Payouts due:

    Contributor: $1000 @bernhardoj (paid in Upwork here - https://www.upwork.com/jobs/~01df7fd3e27a4b1629)
    Contributor+: $1000 @shubham1206agra (paid in Upwork here - https://www.upwork.com/jobs/~01d23451bb0027d3fd)

    Eligible for 50% #urgency bonus? N

    The original Upwork job is closed - @shubham1206agra can you accept my offer in this Upwork job post

  17. shubham1206agra commented on Feb 1, 2024

    @shubham1206agra
    Contributor

    Accepted

  18. Christinadobrzyn commented on Feb 1, 2024

    @Christinadobrzyn
    Contributor

    Paid out @bernhardoj and @shubham1206agra based on this payment summary - #31391 (comment)

    @bernhardoj do we need a regression test for this?

  19. bernhardoj commented on Feb 2, 2024

    @bernhardoj
    Contributor

    @Christinadobrzyn I think it's easy to be broken, so adding a test would be good

    cc: @shubham1206agra

  20. shubham1206agra commented on Feb 2, 2024

    @shubham1206agra
    Contributor

    @Christinadobrzyn Test case

    1. Go to Setting - Profile - Personal details - Legal name
    2. Press Save without any blank First Name.
    3. Enter < 😶‍🌫️>, and observe the error
    4. Remove the space(<😶‍🌫️>), and again observe the error.
    5. Enter spaces one by one after < and observe the error.
  21. Christinadobrzyn commented on Feb 2, 2024

    @Christinadobrzyn
    Contributor

    Created a regression test GH - https://github.com/Expensify/Expensify/issues/366323

    Closing this as complete. Feel free to let me know if anything is needed.

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.DailyKSv2EngineeringExternalAdded 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