Page MenuHomePhabricator

[native] fix newer emojis crashing the app
ClosedPublic

Authored by ginsu on Jul 6 2023, 9:17 PM.
Tags
None
Referenced Files
F2714980: D8435.id28482.diff
Mon, Sep 16, 2:57 AM
F2714723: D8435.diff
Mon, Sep 16, 2:02 AM
F2709260: D8435.id28482.diff
Sun, Sep 15, 8:02 PM
F2709259: D8435.id28463.diff
Sun, Sep 15, 8:02 PM
F2708786: D8435.id.diff
Sun, Sep 15, 4:48 PM
Unknown Object (File)
Fri, Sep 6, 11:14 AM
Unknown Object (File)
Aug 12 2024, 6:59 AM
Unknown Object (File)
Aug 12 2024, 6:59 AM
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.