Skip to content

[HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Able to save empty display first name #44167

Closed

Description

@m-natarajan

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: 9.0.0-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: @allgandalf
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1718910421583419

Action Performed:

Precondition: Have an existing Profile display name

  1. Go to settings -> Profile
  2. Click on display name
  3. Remove the text in first and last name
  4. Hit save

Expected Result:

We should not be able to save empty first name (This will be similar to the onboarding flow, we allow the user to keep last name empty but they have to fill the first name)

Actual Result:

Able to save empty display first 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

Screen.Recording.2024-06-21.at.12.34.19.AM.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e9e958a4df5e3121
  • Upwork Job ID: 1805257830229126291
  • Last Price Increase: 2024-06-24
  • Automatic offers:
    • allgandalf | Reviewer | 102859067
    • eucool | Contributor | 102859068
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @isabelastisser

Activity

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

    @melvin-bot

    Triggered auto assignment to @isabelastisser (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. Krishna2323 commented on Jun 21, 2024

    @Krishna2323
    Contributor

    Proposal

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

    Able to save empty display first name

    What is the root cause of that problem?

    We don't have a check for making the firstname required.

    // First we validate the first name field
    if (!ValidationUtils.isValidDisplayName(values.firstName)) {
    ErrorUtils.addErrorMessage(errors, 'firstName', translate('personalDetails.error.hasInvalidCharacter'));
    } else if (values.firstName.length > CONST.TITLE_CHARACTER_LIMIT) {
    ErrorUtils.addErrorMessage(errors, 'firstName', translate('common.error.characterLimitExceedCounter', {length: values.firstName.length, limit: CONST.TITLE_CHARACTER_LIMIT}));
    }
    if (ValidationUtils.doesContainReservedWord(values.firstName, CONST.DISPLAY_NAME.RESERVED_NAMES)) {
    ErrorUtils.addErrorMessage(errors, 'firstName', translate('personalDetails.error.containsReservedWord'));
    }

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

    Add a check like we do in BaseOnboardingPersonalDetails.

    // First we validate the first name field
    if (values.firstName.replace(CONST.REGEX.ANY_SPACE, '').length === 0) {
    ErrorUtils.addErrorMessage(errors, 'firstName', translate('onboarding.error.requiredFirstName'));
    }

    What alternative solutions did you explore? (Optional)

  4. allgandalf commented on Jun 21, 2024

    @allgandalf
    Contributor

    Note

    @isabelastisser , can i be the C+ here as i reported this issue and already have context

  5. eucool commented on Jun 21, 2024

    @eucool
    Contributor

    Proposal

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

    Able to save name without first name

    What is the root cause of that problem?

    We do not validate whether the name is empty or not when we click save, we only check for special characters and word limit

    

This is why we do not get any error while saving empty name.

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

    We can add a validation check similar to the onboarding page which checks whether the name is empty and gives error if the first name is empty, we can apply similar logic here.

    We should create a new error message here because the other one is used for onboarding flow/ or we can reuse the same variable.

    Then we should add a validation to check for the empty first name and throw error accordingly:

    if (values.firstName.length === 0) {
                ErrorUtils.addErrorMessage(errors, 'firstName', translate('onboarding.error.requiredFirstName'));
            }
    • Couple of points here:
      • We do not need to add a extra .replace(CONST.REGEX.ANY_SPACE, '') like we do in the onboarding flow, because extra whitespaces are trimmed by default
    Screenshot 2024-06-21 at 10 50 23 PM
    • We can create a separate text as it won't be ideal to use from the onboarding flow as the current errors for the display name are set personalDetails messages

    What alternative solutions did you explore? (Optional)

  6. isabelastisser commented on Jun 22, 2024

    @isabelastisser
    Contributor

    @allgandalf can you please review the proposals above? Thanks!

  7. allgandalf commented on Jun 22, 2024

    @allgandalf
    Contributor

    @eucool's proposal looks good to me here.

    We can create a separate text as it won't be ideal to use from the onboarding flow as the current errors for the display name are set personalDetails messages

    I would like the opinion of the internal engineer here if we should create a new text or reuse the same from onboarding flow, anyway NAB 👍

    🎀👀🎀 C+ reviewed

  8. melvin-bot commented on Jun 22, 2024

    @melvin-bot

    Triggered auto assignment to @bondydaa, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  9. allgandalf commented on Jun 22, 2024

    @allgandalf
    Contributor

    @isabelastisser can you add an external tag here for the job to be created on upwork, thanks :)

  10. Krishna2323 commented on Jun 22, 2024

    @Krishna2323
    Contributor

    Hey @allgandalf, could you let me know if there's anything wrong with my proposal?

  11. Krishna2323 commented on Jun 24, 2024

    @Krishna2323
    Contributor

    @bondydaa, please hold off on assigning. I am still confused why my proposal wasn't selected. The solution is straightforward, and my proposal includes all the necessary details. I am still waiting for a response from @allgandalf.

  12. 29 remaining items

  13. changed the title [-][HOLD for payment 2024-07-17] [$250] Able to save empty display first name[/-] [+][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Able to save empty display first name[/+] on Jul 15, 2024
  14. melvin-bot commented on Jul 15, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 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-07-22. 🎊

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

  15. melvin-bot commented on Jul 15, 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:

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

    @allgandalf
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Update display name front-end validation to match back-end #14873 (this was a missed case and not really a bug from that PR)

    • 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/14873/files#r1678876418

    • 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: N/A

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

    Regression Test Proposal

    • Precondition: Have an existing Profile display name
    1. Go to settings -> Profile
    2. Click on display name
    3. Remove the text in first name.
    4. Hit save
    • Verify that error occurs when saving empty First Name.

    Note: We are allowed to have last name as empty

    Do we agree 👍 or 👎

  17. allgandalf commented on Jul 16, 2024

    @allgandalf
    Contributor

    Note

    @isabelastisser , this is ready for payment, the payment date is wrong, idk why melvin is acting so weird lately, I notified about the deployment to production here, so the payment date was actually 15th, can you pay this out please, thanks

  18. isabelastisser commented on Jul 16, 2024

    @isabelastisser
    Contributor

    Thanks for the heads up, @allgandalf!

    @bondydaa, can you please review the regression test above? Thanks!

  19. isabelastisser commented on Jul 16, 2024

    @isabelastisser
    Contributor

    The payments were processed in Upwork!

  20. bondydaa commented on Jul 16, 2024

    @bondydaa
    Contributor

    regression steps look good

  21. eucool commented on Jul 18, 2024

    @eucool
    Contributor

    The payments were processed in Upwork!

    I can still see that the job is pending payment @isabelastisser , can you confirm once please

  22. isabelastisser commented on Jul 18, 2024

    @isabelastisser
    Contributor

    Hi @eucool, it was paid on July 16:

    image
  23. isabelastisser commented on Jul 18, 2024

    @isabelastisser
    Contributor

    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