HomePhabricator
Diffusion Comm 6de5244eb669

[native] fix newer emojis crashing the app

Description

[native] fix newer emojis crashing the app

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]

Reviewers: atul, kamil, ashoat

Reviewed By: ashoat

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D8435

Details

Provenance
ginsuAuthored on Jul 7 2023, 8:51 AM
Reviewer
ashoat
Differential Revision
D8435: [native] fix newer emojis crashing the app
Parents
rCOMM8f2e05727f8d: [web] Update Blob service DELETE endpoint call
Branches
Unknown
Tags
Unknown