Fix linkedin regex acceptance (issue #1507)#5133
Conversation
Fixes dailydotdev#1507 - Accented characters not being accepted in the app for handles Updated regex patterns in packages/shared/src/graphql/users.ts to use Unicode property escapes (\p{L} for letters, \p{N} for numbers) instead of ASCII-only character classes. This enables support for international characters such as: - Spanish: José, í, ó - French: François, café - German: Müller, über - Scandinavian: Björn, Øyvind - And many other Unicode characters The fix maintains backward compatibility with existing ASCII usernames while making the platform inclusive for global users.
Add comprehensive test coverage for the Unicode character support fix: - Tests accented characters in social handles (ítalo-oliveira, José, François) - Tests Unicode characters from various languages (Cyrillic, Chinese, Arabic) - Tests mixed Unicode and ASCII combinations - Verifies backward compatibility with ASCII characters - Tests edge cases and validation rules
|
@syu213 is attempting to deploy a commit to the Daily Dev Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@syu213 thanks a lot for the contribution. can you validate if other social networks allow unicode? This might be a linkedin only thing |
looked into it, youtube allows it too, but others (x, github, instagram) dont allow usernames to have it, worst case is they try a instagram username with unicode like @Café (instagram.com/caf%C3%A9/) and it just gives back a 404 error as if they made a typo in their url. (same as if they did instagram.com/asdnasnid190341923901209/ or something, just gives back Profile isn't available |
|
Fair enough, last thing, you should open a PR for our api to update the regex there as well. Otherwise, client validation passes but server validation will fail. See here: https://github.com/dailydotdev/daily-api/blob/29c67c0eb48c7306378e47962d2e0fcb18b3a9f5/src/common/object.ts#L49 |
yup, here is the PR for the daily-api repo! please let us know if they are valid, or if any changes are necessary |
|
Thanks a lot! For the contribution 💪 |
Changes
media usernames
handleRegexandsocialHandleRegexinpackages/shared/src/graphql/users.tstouse Unicode property escapes (
\p{L}for letters,\p{N}for numbers)Events
Did you introduce any new tracking events?
No
Experiment
Did you introduce any new experiments?
No
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR