Page MenuHomePhabricator

[native] fix newer emojis crashing the app
ClosedPublic

Authored by ginsu on Jul 6 2023, 9:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 17, 11:22 PM
Unknown Object (File)
Tue, Jul 16, 8:55 PM
Unknown Object (File)
Fri, Jul 12, 3:29 PM
Unknown Object (File)
Sat, Jul 6, 3:30 AM
Unknown Object (File)
Fri, Jul 5, 1:19 PM
Unknown Object (File)
Thu, Jul 4, 12:06 PM
Unknown Object (File)
Tue, Jul 2, 6:48 PM
Unknown Object (File)
Jun 17 2024, 2:43 PM
Subscribers

Details

Summary

As I was working on fixing the emoji keyboard colors I would encounter a bug sometimes when I rendered the emoji keyboard on the screen.

Screenshot 2023-07-06 at 4.16.50 PM.png (1×1 px, 778 KB)

Screenshot 2023-07-06 at 4.16.45 PM.png (1×1 px, 871 KB)

After some digging, I realized that this was being triggered because rn-emoji-keyboard uses an older unicode version so some of the newer emojis like (🫡) that were already selected from a different client (web) could not be found in the keyedEmojiData.

To fix this I made keyedEmojiData[emoji] optional so if a newer emoji is used instead of throwing an error the function will return undefined.

I have talked to the authors of the rn-emoji-keyboard library about this and they said that we should expect to see rn-emoji-keyboard use a newer unicode version in the coming months.

Test Plan

Confirmed that the alreadySelected value looked like this and the crash no longer happens with emojis from a more recent unicode version

Logs:

LOG  currentlySelected:
LOG  ["red heart", undefined]

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.Jul 6 2023, 9:35 PM
ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: atul, kamil.

Does this fix a bug that is live in production? If so, can you please coordinate with @atul to get a new release out?

This revision is now accepted and ready to land.Jul 7 2023, 8:43 AM

Does this fix a bug that is live in production? If so, can you please coordinate with @atul to get a new release out?

Yea unfortunately this bug lives in prod atm, will message @atul about getting a release out asap

This revision was automatically updated to reflect the committed changes.