-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$500] BA - No validation error when emoji and certain symbols are entered in name field #32291
Comments
Triggered auto assignment to @trjExpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Regression from linked PR |
Not regression. This validation was never happened before #30674. |
ProposalPlease re-state the problem that we are trying to solve in this issue.BA - No validation error when emoji and certain symbols are entered in name field. What is the root cause of that problem?We only check validation to determine if the name is empty, there is no validation in place to ensure that the name contains only Latin characters. What changes do you think we should make in order to solve the problem?We should add an 'if' statement to check whether the name contains only valid App/src/libs/ValidationUtils.ts Lines 303 to 305 in 1682be4
Updated code should look like: // Inside `validate` function in `RequestorStep.js`
if (!ValidationUtils.isValidPersonName(values.firstName)) {
errors.firstName = 'bankAccount.error.firstName';
}
if (!ValidationUtils.isValidPersonName(values.lastName)) {
errors.lastName = 'bankAccount.error.lastName';
} ResultWhat alternative solutions did you explore? (Optional)Or we can use App/src/libs/ValidationUtils.ts Lines 326 to 329 in 50865ef
|
So looking at the linked PR we explicitly decided not to exclude special characters in the name field as per here. It's unclear if that matched Onfido's requirements or not? CC: @stitesExpensify as you reviewed that PR as well. @0xmiroslav assigning you for the time being. |
We don't check for onfido's requirements on the front end or back end currently. I posted the backend logic on the other issue and we just strip out a specific set of characters. This seems like a nice to have, but honestly if you're putting random random characters and emojis in your name and it fails, I'm not too concerned by that. |
If we want to add |
Right, but do you agree there should be an error message then? Otherwise there's no feedback at all to indicate why the form won't submit, or am I not following something? |
Oh, you can't submit? My understanding was that you could submit but would get an error message |
Right, so that screenshot shows that you can submit with the first name wrong, and then you would get an error afterwards which isn't really a big deal if you're putting things like @ and emojis in the first name. Regardless, it should probably be fixed to match the rest of them. |
@0xmiroslav feel free to check out proposals here |
Right, our forms design never prevents you from clicking the
There's no error being shown on the first name field, that's the problem. |
Does BE show any errors if we send emojis in the name? |
ProposalPlease re-state the problem that we are trying to solve in this issue.Error does not show up on the name field with invalid symbols and emoji. Only certain symbols pass the validation What is the root cause of that problem?In here, we're only restrict some symbols so other symbols and emojis are still allowed in the first name and last name field. What changes do you think we should make in order to solve the problem?Extend the regex here to exclude other symbols and also exclude emojis. The emoji regex can be taken from What alternative solutions did you explore? (Optional)We can use Or legal name check can also follow the same as bank account first and last name check. Regarding the Greek and Cyrillic alphabets here #32291 (comment), I think both legal name and bank account name should follow the same rule and can use the same regex. But if only bank account name needs to support those alphabets but legal name doesn't, then we'll make another regex for the bank account name. |
@0xmiroslav over to you for the proposal review, please! |
There're various solutions to invalidate emoji but I'm inclined to the solution which only validates language alphabets. |
On hold, moving this to weekly while we wait. |
Ah sorry, forgot to drop it to Still held on #34498 |
Okay so #34498 has merged. Taking this off hold. We should be good to proceed here now @Krishna2323. |
Raising PR today. |
@Ollyws PR ready for review :) |
PR hit staging 15 hours ago. |
@NikkiWines friendly bump for payments here :), PR was deployed to production on 29th Feb. |
@trjExpensify can you issue payment, please? Thank you 🙇 |
Payment summary: @Krishna2323 paid $500 for the fix |
Accepted, thanks. |
Paid, closing. Thanks, everyone! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.6.2
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:
Issue found when executing PR #30674
Action Performed:
Expected Result:
Error will show up on the name field with invalid symbols and emoji
Actual Result:
Error does not show up on the name field with invalid symbols and emoji. Only certain symbols pass the validation
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6296280_1701365098247.20231130_214539.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: