Closed izarutskaya closed 4 weeks ago
Triggered auto assignment to @alexpensify (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.
We think this issue might be related to the #vip-vsb.
Group - Invalid group chat name entered after group creation shows error.
No validation for invalid group name is added on the frontend and the backend only returns error when group name is updated. https://github.com/Expensify/App/blob/e3b508b89933b44f5ccd59e65e8152ad2f47a6d6/src/pages/GroupChatNameEditPage.tsx#L56-L66
We should add validation check on the frontend also, for validation we should add the same regex/check used in the backend.
Invalid group chat name entered while creating group from the BE.
We simply validated the name length by name.length
:
However, in the test string, there was an Unicode character ỏ
or ỏ
which would be counted differently instead of just 1
(reference here). That's why the validation passed in the FE but failed in the BE.
We need to match the length validation with the BE by using getCommentLength
:
Other GHs have been a priority, I'll review soon
Job added to Upwork: https://www.upwork.com/jobs/~0114cd4bde59962aa8
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External
)
@sobitneupane - can you review if one of these proposals will fix this problem? Thanks!
Refer to comment, in BE side, we check if the report name is valid or not based on:
strlen(reportName) <= 100
with strlen
function from PHP. In PHP, strlen counts bytes. With the text mentioned in OP, the strlen()
return 102
.
In FE, we check if the report name is valid or not based on:
https://github.com/Expensify/App/blob/81bc5b0bc03d1cbf731a4ab2de1e1968e0aef781/src/libs/ValidationUtils.ts#L338
in here, JavaScript string.length
counts characters. With the text mentioned in OP, string.length
return 100
.
That leads to inconsistency when validating between FE and BE.
We need to update: https://github.com/Expensify/App/blob/81bc5b0bc03d1cbf731a4ab2de1e1968e0aef781/src/libs/ValidationUtils.ts#L337-L339 to:
function isValidReportName(name: string) {
return new Blob([name.trim()]).size <= CONST.REPORT_NAME_LIMIT;
}
In above, we count bytes instead of character to sync with BE.
Remove the maxLength value
in InputComponent
because we already have the validate function to handle if user exceeds max length.
We should handle the similar related inconsistency issue.
Thanks for the proposal everyone.
Proposal from @dominictb looks good to me. The change proposed will ensure the FE validation. We might want to validate the groupChatName in BE as well during group creation. Looks like the validation is only done when groupChatName is updated.
🎀 👀 🎀 C+ reviewed
Triggered auto assignment to @NikkiWines, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
agreed that @dominictb's proposal looks good 👍
📣 @dominictb 🎉 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 📖
Awesome, this PR is moving along, and we are waiting for it to go to production.
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.14-6 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-08-07. :confetti_ball:
For reference, here are some details about the assignees on this 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:
Noted that the payment date is on August 7
Payouts due: August 7, 2024
Upwork job is here.
Closing - the upwork process is complete
$250 approved for @sobitneupane
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.8 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4730508 Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
Invalid group chat name entered while creating group or after group creation must behave in the same way.
Actual Result:
Invalid group chat name entered while creating group not showing error but entered after group creation shows error.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
https://github.com/user-attachments/assets/b1129b91-b0a2-49fe-a8e4-8c1817d30b3a
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @alexpensify