-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix Safari emoji corruption bug by inserting ZWNJ between digits/symbols (#, *) and emojis #79265
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
base: main
Are you sure you want to change the base?
Fix Safari emoji corruption bug by inserting ZWNJ between digits/symbols (#, *) and emojis #79265
Conversation
…ols (#, *) and emojis
…n they follow emojis
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65083795ac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
| return input.replaceAll(CONST.REGEX.DIGIT_FOLLOWED_BY_EMOJI, '$1\u200C$2'); | ||
|
|
||
| let result = input.replaceAll(/([\d#*])\uFE0F?\u20E3/gu, '$1'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve keycap emoji instead of stripping them
The new normalization step removes the U+20E3 keycap combining mark for any 0-9, #, or * sequence (e.g., 1️⃣, *️⃣) before doing the ZWNJ insertion. On Safari this will convert legitimate keycap emoji selected from the emoji picker into plain characters, permanently altering the user’s message content even when no corruption occurs. This is a regression from the previous behavior (which left keycap emoji intact) and will cause Safari users to lose intended keycap emoji in messages.
Useful? React with 👍 / 👎.
Explanation of Change
This PR inserts a Zero-Width Non-Joiner (ZWNJ) between #/* and emojis, preventing Safari from creating these sequences and ensuring the text displays correctly.
Fixed Issues
$ #75634
PROPOSAL: #75634 (comment)
Tests
Testing Steps for New Message
Testing Steps for Edit Message
Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-01-10.at.4.01.36.AM.mov
Android: mWeb Chrome
Screen.Recording.2026-01-10.at.3.51.44.AM.mov
iOS: Native
Screen.Recording.2026-01-10.at.3.47.17.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-01-10.at.3.44.45.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-01-10.at.1.50.58.AM.mov