-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 2023-03-24] [$1000] Personal details - Signs *-+ added to the start of a Legal first name and last name don't save #15741
Comments
Triggered auto assignment to @garrettmknight ( |
Bug0 Triage Checklist (Main S/O)
|
@kbecciv Can you point me to the slack link? I'm not sure if those symbols should be valid for legal names or not. |
I don't have slack conversation for this and don't have access to slack |
@garrettmknight Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Chatting about standards in slack, will come back here when we've confirmed what requirements we have. https://expensify.slack.com/archives/C049HHMV9SM/p1678742598359799 |
Job added to Upwork: https://www.upwork.com/jobs/~01e1a71adab59f1386 |
Current assignee @garrettmknight is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Triggered auto assignment to @PauloGasparSv ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Whenever we enter symbols (e.g. *-+) within Legal first name and last name, it will not store that symbol within db and firstname/lastname return empty when once data saved within onyx. What is the root cause of that problem?For legal name validation we are using App/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js Lines 69 to 79 in 1860947
It will check for commas or semicolons at line 358 shown in code below. So it will allow special chars other than commas or semicolons. Note: Actually this function is used for profile display name settings. App/src/libs/ValidationUtils.js Lines 357 to 359 in 1860947
So for legal name if we enter special chars (other then commas or semicolons) then ui will not show any error, and when we tap Save it will call server side api that make legalFirstName or legalLastName blank due to invalid chars found within it. We can see this behaviour in the issue video. What changes do you think we should make in order to solve the problem?We have to create function isValidLegalName(name) {
return CONST.REGEX.ALPHABETIC_CHARS_ONLY.test(name);
} Add corresponding regular expression within CONST.js file as shown below: REGEX: {
....
ALPHABETIC_CHARS_ONLY: /^[A-Za-z-]*$/,
....
} So we have to adjust this regular expression to allow chars we need. At present I set a-z and A-Z and - (dash) but we can allow more char as per our need. If any existing regex there for such requirement in COST.js file then also we can use it. Within en.js add privatePersonalDetails: {
...
error: {
...,
hasInvalidCharacter: 'Name contains unsupported character.',
},
}, Within es.js add privatePersonalDetails: {
...
error: {
...,
hasInvalidCharacter: 'El nombre contiene un carácter no admitido.',
},
}, Update validate logic as shown below. i.e. We have to use if (!ValidationUtils.isValidLegalName(values.legalFirstName)) { // *** Updated code ***
errors.legalFirstName = this.props.translate('privatePersonalDetails.error.hasInvalidCharacter'); // *** Updated code ***
} else if (_.isEmpty(values.legalFirstName)) {
errors.legalFirstName = this.props.translate('common.error.fieldRequired');
}
if (!ValidationUtils.isValidLegalName(values.legalLastName)) { // *** Updated code ***
errors.legalLastName = this.props.translate('privatePersonalDetails.error.hasInvalidCharacter'); // *** Updated code ***
} else if (_.isEmpty(values.legalLastName)) {
errors.legalLastName = this.props.translate('common.error.fieldRequired');
} What alternative solutions did you explore? (Optional)None |
ProposalPlease re-state the problem that we are trying to solve in this issue.In the Personal Details > Legal Name section, we do not allow the user to have any special characters in their names. What is the root cause of that problem?This is because of backend validation. The reason behind confusing behaviour is because we do not restrict the values or show any error on the frontend and when values are sent to the backend, they are filtered and updated on the frontend, causing confusion. What changes do you think we should make in order to solve the problem?Across the world, there are many cultures and different countries have different allowed Legal names. I was able to find a very good article on this. The most common however, include the use of hyphens, apostrophes and periods. Many a times, people also have a middle name as well. I propose that we create a new function in the validation utils specifically for validating the legal name. It can use a regex that allows:
This will allow a user which has a legal name > 2 words to enter their name as well. We could also potentially create a new field just for middle name. For any other inputs not matching the above conditions, we will show an error with the allowed characters. Moreover, currently we allow to save the form with empty spaces only, which will also be fixed using my proposal. This issue will require changes on the backend as well. |
Hey @Prince-Mendiratta I think we strip some of those characters in the API side before the request gets to the endpoint. But you made a very valid point about which characters we should be allowing here. I think the API is only ready for accepting numbers and letters for that field, so that's what we should be allowing in the App! |
@sobitneupane I think we already have 2 good proposals here that can fix the problem, could you share your thoughts on them? |
Thanks for the proposal @PrashantMangukiya and @Prince-Mendiratta. Proposal from @PrashantMangukiya looks good to me. 🎀👀🎀 C+ reviewed cc: @PauloGasparSv |
Thanks @PauloGasparSv @sobitneupane Applied to job on Upwork. I will submit PR within few hours asap. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.86-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 2023-03-24. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
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:
|
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
Ping for Upwork |
Not overdue, filling my part of the checklist today : ) |
Ping for Upwork. Should I also eligible for timeline bonus as pr merged within three business days. |
Regression Test Proposal
Do we agree 👍 or 👎 |
@PrashantMangukiya just paid you and closed the contract. |
@garrettmknight Received Thank you for your time. |
@garrettmknight Accepted the offer |
Paid and contract ended. @sobitneupane can you link the reg testing step issue here when you get a chance? |
@garrettmknight I am not familiar with TestRail. According to https://expensify.slack.com/archives/C02NK2DQWUX/p1679650722829939?thread_ts=1679597927.757039&cid=C02NK2DQWUX, Applause will find the appropriate location to add the test steps. |
Thanks @sobitneupane - all done! |
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:
Expected Result:
Error message should be display for unsupported symbols
Actual Result:
Signs *-+ are not stored in Legal first name and last name
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.80.0
Reproducible in staging?: Yes
Reproducible in production?: yes
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
Bug5968608_Gravar__2078.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: