Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 6 tasks
m-natarajan opened this issue Jun 21, 2024 · 33 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@m-natarajan
Copy link

m-natarajan commented Jun 21, 2024

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
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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.

@Krishna2323
Copy link
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)

@allgandalf
Copy link
Contributor

Note

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

@eucool
Copy link
Contributor

eucool commented Jun 21, 2024

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)

@isabelastisser
Copy link
Contributor

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

@allgandalf
Copy link
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

Copy link

melvin-bot bot commented Jun 22, 2024

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

@allgandalf
Copy link
Contributor

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

@Krishna2323
Copy link
Contributor

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

@Krishna2323
Copy link
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.

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2024
@allgandalf
Copy link
Contributor

allgandalf commented Jun 24, 2024

Given how straightforward this bug was, I think the minor details(of not trimming the values and the addition of extra text/ reusing same text) should have been thought off here.

I leave it to the Internal engineer(@bondydaa) for final assignment 🙏

@melvin-bot melvin-bot bot removed the Overdue label Jun 24, 2024
@Krishna2323
Copy link
Contributor

Krishna2323 commented Jun 24, 2024

@allgandalf, I don't think we should select proposals based on minor details. I had the correct RCA and solution before the second proposal. Doesn't having the first correct RCA and solution matter? Are only minor details considered?

extra text/ reusing same text

Don't you think that this would have been discussed in the PR?

@allgandalf, no offence but I don't think we select proposals based on minor details not RCA and solution.

@allgandalf
Copy link
Contributor

Let’s wait on the internal engineers decision here, I would be more than happy to work with either of you two @Krishna2323 🙏 Thanks

@isabelastisser isabelastisser added External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Jun 24, 2024
@melvin-bot melvin-bot bot changed the title Able to save empty display first name [$250] Able to save empty display first name Jun 24, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01e9e958a4df5e3121

Copy link

melvin-bot bot commented Jun 24, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 24, 2024
Copy link

melvin-bot bot commented Jun 24, 2024

📣 @allgandalf 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Jun 24, 2024

📣 @eucool 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@bondydaa
Copy link
Contributor

assigning @eucool b/c the proposal is more complete to me.

I agree we should probably create new error messages in the personalDetails.error object that are more tailored to this setting page, something like First name cannot be empty instead of the Please input your first name to continue. from requiredFirstName.

@allgandalf
Copy link
Contributor

Automation failed ⚠️ , the PR was deployed to 2 days ago

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 10, 2024
@melvin-bot melvin-bot bot changed the title [$250] Able to save empty display first name [HOLD for payment 2024-07-17] [$250] Able to save empty display first name Jul 10, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 10, 2024
Copy link

melvin-bot bot commented Jul 10, 2024

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

Copy link

melvin-bot bot commented Jul 10, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.5-13 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-17. 🎊

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

Copy link

melvin-bot bot commented Jul 10, 2024

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:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 15, 2024
@melvin-bot melvin-bot bot 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 Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

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:

Copy link

melvin-bot bot commented Jul 15, 2024

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:

@allgandalf
Copy link
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 👎

@allgandalf
Copy link
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

@isabelastisser
Copy link
Contributor

Thanks for the heads up, @allgandalf!

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

@isabelastisser
Copy link
Contributor

The payments were processed in Upwork!

@bondydaa
Copy link
Contributor

regression steps look good

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 16, 2024
@eucool
Copy link
Contributor

eucool commented Jul 18, 2024

The payments were processed in Upwork!

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

@isabelastisser
Copy link
Contributor

Hi @eucool, it was paid on July 16:

image

@isabelastisser
Copy link
Contributor

All set!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants