Skip to content

[HOLD for payment 2024-02-07] [$500] Display Name - User can save Expensify and Concierge as a last name while error is thrown #34304

Closed

Description

@lanitochka17

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: 1.4.24-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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Navigate to Settings > Profile > Display Name
  2. Enter either 'Expensify' or 'Concierge' as the last name
  3. Click on 'Save' button

Expected Result:

User shouldn't be able to save the 'Expensify' or 'Concierge' as last name

Actual Result:

User is able to save the 'Expensify' or 'Concierge' as last name

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

Bug6338345_1704929835247.Screen_Recording_2024-01-10_at_10.34.33_at_night.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01afa29712aeb0580b
  • Upwork Job ID: 1745234409296494592
  • Last Price Increase: 2024-01-18
  • Automatic offers:
    • fedirjh | Reviewer | 28119205
    • dukenv0307 | Contributor | 28119206

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 11, 2024
  2. changed the title [-]Display Name - User can save Expensify and Concierge as a last name while error is thrown[/-] [+][$500] Display Name - User can save Expensify and Concierge as a last name while error is thrown[/+] on Jan 11, 2024
  3. melvin-bot commented on Jan 11, 2024

    @melvin-bot
  4. melvin-bot commented on Jan 11, 2024

    @melvin-bot

    Triggered auto assignment to @zanyrenney (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 Jan 11, 2024
  6. melvin-bot commented on Jan 11, 2024

    @melvin-bot

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

  7. neonbhai commented on Jan 11, 2024

    @neonbhai
    Contributor

    Proposal

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

    Display Name - User can save Expensify and Concierge as a last name while error is thrown

    What is the root cause of that problem?

    This happens as we are not checking the lastName for reserved words on this page:

    const validate = (values) => {
    const errors = {};
    // First we validate the first name field
    if (!ValidationUtils.isValidDisplayName(values.firstName)) {
    ErrorUtils.addErrorMessage(errors, 'firstName', 'personalDetails.error.hasInvalidCharacter');
    }
    if (ValidationUtils.doesContainReservedWord(values.firstName, CONST.DISPLAY_NAME.RESERVED_FIRST_NAMES)) {
    ErrorUtils.addErrorMessage(errors, 'firstName', 'personalDetails.error.containsReservedWord');
    }
    // Then we validate the last name field
    if (!ValidationUtils.isValidDisplayName(values.lastName)) {
    errors.lastName = 'personalDetails.error.hasInvalidCharacter';
    }
    return errors;
    };

    What changes do you think we should make in order

    We should add error checking like we did for first Name

    if (ValidationUtils.doesContainReservedWord(values.lastName, CONST.DISPLAY_NAME.RESERVED_LAST_NAMES)) { 
       ErrorUtils.addErrorMessage(errors, 'firstName', 'personalDetails.error.containsReservedWord'); 
    }

    Alternatively

    We may add failure data for this request here:

    function updateDisplayName(firstName: string, lastName: string) {

  8. abzokhattab commented on Jan 11, 2024

    @abzokhattab
    Contributor

    Proposal

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

    Display Name - User can save Expensify and Concierge as a last name while error is thrown

    What is the root cause of that problem?

    We dont check if the last name is one of the reserved words similar to first name

    if (ValidationUtils.doesContainReservedWord(values.firstName, CONST.DISPLAY_NAME.RESERVED_FIRST_NAMES)) {
    ErrorUtils.addErrorMessage(errors, 'firstName', 'personalDetails.error.containsReservedWord');
    }

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

    we need to add a validation here for the last name as well

     if (ValidationUtils.doesContainReservedWord(values. lastName, CONST.DISPLAY_NAME.RESERVED_FIRST_NAMES)) { 
             ErrorUtils.addErrorMessage(errors, 'lastName', 'personalDetails.error.containsReservedWord'); 
         } 
  9. dukenv0307 commented on Jan 11, 2024

    @dukenv0307
    Contributor

    Proposal

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

    User is able to save the 'Expensify' or 'Concierge' as last name

    What is the root cause of that problem?

    1. In here, we're not validating that the lastName doesn't contain the reserved words similar to what we did with the first name
    2. When we save the legal name (also has first name and last name), if the display names are not set, it will also set the displayName to same as legal name. So the user can save reserved words like Expensify and Concierge as legal name and it will be shown as the display name, and then if the user goes to the display name page and click Save it will show error. We don't currently have any reserved words validation for legal name.

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

    1. Validate reserved words for lastName here similar to for first name. We might want to change RESERVED_FIRST_NAMES to RESERVED_NAMES because it doesn't just apply to first name
    2. Add reserved words validation for both first name and last name, to the legal name page. We can optionally fix the back-end to reject legal names that contain reserved words as well

    What alternative solutions did you explore? (Optional)

    We should additionally evaluate other names like workspace names, room names, personal bank information first & last names, ... to see if we should apply the same reserved words restriction, I think it makes sense to restrict in those places as well to reduce frauds.

    Another approach for 2, is to remove the linkage between Legal name and Display name, so if Display name is not already set, when we set Legal name, it should not set Display name to the same values.

  10. mkhutornyi commented on Jan 11, 2024

    @mkhutornyi
    Contributor

    I think it's intentional to validate only first name but not last name. And it's what backend already does.
    Originally implemented in #14873 to fix #13779
    cc: @puneetlath

  11. fedirjh commented on Jan 11, 2024

    @fedirjh
    Contributor

    I think it's intentional to validate only first name but not last name. And it's what backend already does.

    @mkhutornyi It seems that the backend also validates the last name and that’s why it throws this error :

    Screenshot 2024-01-11 at 2 13 44 PM
  12. 33 remaining items

  13. added
    ReviewingHas a PR in review
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Jan 26, 2024
  14. changed the title [-][$500] Display Name - User can save Expensify and Concierge as a last name while error is thrown[/-] [+][HOLD for payment 2024-02-07] [$500] Display Name - User can save Expensify and Concierge as a last name while error is thrown[/+] on Jan 31, 2024
  15. melvin-bot commented on Jan 31, 2024

    @melvin-bot

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

  16. melvin-bot commented on Jan 31, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.34-1 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 2024-02-07. 🎊

    For reference, here are some details about the assignees on this issue:

  17. melvin-bot commented on Jan 31, 2024

    @melvin-bot

    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:

    • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
    • [@fedirjh] 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:
    • [@fedirjh] 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:
    • [@fedirjh] Determine if we should create a regression test for this bug.
    • [@fedirjh] 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.
    • [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  18. zanyrenney commented on Feb 7, 2024

    @zanyrenney
    Contributor

    Payment summary

    @fedirjh requires payment automatic offer (Reviewer) - PAID $500
    @dukenv0307 requires payment automatic offer (Contributor) PAID $500

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