You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chat-:thumbsup: doesn't replaced with emoji. #87453
Version Number: V9.3.55-0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#87253 Email or phone of affected tester (no customers):dreamnitethedragon+vegst@gmail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Redmi note 10s android 13 App Component: Chat Report View
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #87253 - "Deferring Trie Build" by @elirangoshen (High confidence) Related Issues: #86759
Recommendation: REVERT
PR #87253 introduced a regression in the lazy emoji trie loading logic that causes emoji shortcodes to never be replaced with actual emojis. Reverting this PR restores the eager trie-build behavior from LocaleContextProvider and unblocks the deploy.
The PR defers emoji trie construction from app startup (eager, in LocaleContextProvider) to first use (lazy, via getEmojiTrie() in EmojiUtils).
The bug reproduces on staging only (the issue states "N/A - new feature, does not exist in prod"), confirming this is a staging-only regression introduced by this PR.
localeEmojis in assets/emojis/index.ts is initialized as {en: undefined, es: undefined}. The new buildEmojisTrie logic checks if (!localeEmojis[locale]) -- since the locale data starts as undefined, this condition is always true on the first call. The function then kicks off importEmojiLocale(locale) (an async dynamic import), and immediately returns without building the trie. There is no .then(() => buildEmojisTrie(locale)) chained to that promise, so once the locale data finishes loading, the trie is never actually constructed. As a result, getEmojiTrie() returns undefined on every call until the locale data has been loaded AND buildEmojisTrie is called a second time, which never happens automatically. The replaceEmojis function in EmojiUtils.tsx exits early when the trie is undefined, leaving the shortcode text unreplaced.
PR #87253 deferred the emoji trie build from app startup to first use. The problem is in src/libs/EmojiTrie.ts:116-131: when getEmojiTrie is called for the first time, localeEmojis[locale] is still undefined (the locale data hasn't been dynamically imported yet). buildEmojisTrie fires importEmojiLocale(locale) asynchronously but returns immediately without building the trie. The .then() callback only ends a telemetry span — it never calls buildEmojisTrie again after the import completes.
What changes do you think we should make in order to solve the problem?
In buildEmojisTrie (src/libs/EmojiTrie.ts:127-129), the .then() callback after importEmojiLocale should actually build the trie once the import resolves:
importEmojiLocale(locale).then(()=>{endSpan(CONST.TELEMETRY.SPAN_LOCALE.EMOJI_IMPORT);buildEmojisTrie(locale);// Actually build the trie now that locale data is loaded});
However, this alone doesn't fix the first call to replaceEmojis — the trie won't exist yet during that synchronous call. To fully fix this, the import should also be triggered earlier so the locale data is ready before the user types. This could be done by calling importEmojiLocale in LocaleContextProvider on locale change (as it was before the PR), while still deferring the expensive trie construction to first use.
What alternative solutions did you explore? (Optional)
Revert PR Deferring Trie Build #87253 entirely — simplest fix but loses the startup performance improvement.
Make replaceEmojis async — would require changes to all callers and the message sending pipeline, which is too invasive.
Pre-warm the import in LocaleContextProvider without building the trie — best of both worlds: the dynamic import starts eagerly (so data is ready), but the trie build stays lazy. This is the recommended approach.
Investigation details
Data flow of the bug:
App starts → localeEmojis['en'] is undefined (emoji locale data not yet dynamically imported)
Previously, LocaleContextProvider eagerly called buildEmojisTrie, which imported locale data and built the trie before user interaction
User types :thumbsup: → replaceEmojis → getEmojiTrie('en') → buildEmojisTrie('en')
buildEmojisTrie sees localeEmojis['en'] is undefined, fires async importEmojiLocale('en'), returns immediately
getEmojiTrie returns undefined → replaceEmojis returns original text unchanged
The import eventually resolves in the background, but nothing re-triggers replaceEmojis
On the second message attempt, the locale data is loaded, the trie gets built, and emoji replacement works
Key code locations:
src/libs/EmojiTrie.ts:122-131 — early return without building trie when locale data not loaded
src/libs/EmojiTrie.ts:143-146 — getEmojiTrie returns undefined on first call
src/libs/EmojiUtils.tsx:397-400 — replaceEmojis bails out when trie is undefined
assets/emojis/index.ts — localeEmojis initialized with all values as undefined
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
The emoji's name is +1, not :thumbsup:. :thumbsup: is only a keyword (for search/suggestions).
also in prod 👍 is not giving any emoji so i think that the qa test is might be wrong
more technical info :
The emoji names in common.ts follow the GitHub emoji shortcode convention (from gemoji), where thumbs up is :+1: not :thumbsup:. GitHub actually supports both — :+1: and :thumbsup: are aliases for the same
emoji.
Our codebase only has one name per emoji (the primary), and thumbsup is only a keyword for search. GitHub for example maintains an alias list where multiple shortcodes map to the same emoji. - which explain why the review might thinks we missing this - but its not issue seems it was like this before. if you want I can open pr to add this one to our list so it will be supported ?
Activity
melvin-bot commentedon Apr 9, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #87253
melvin-bot commentedon Apr 9, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 9, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon Apr 9, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #87253 - "Deferring Trie Build" by @elirangoshen (High confidence)
Related Issues: #86759
Recommendation: REVERT
PR #87253 introduced a regression in the lazy emoji trie loading logic that causes emoji shortcodes to never be replaced with actual emojis. Reverting this PR restores the eager trie-build behavior from LocaleContextProvider and unblocks the deploy.
Assigned: @elirangoshen (PR author), @Julesssss (approving reviewer), @roryabraham (approving reviewer)
Labels: DeployBlockerCash kept (Frontend bug in App repo). No label changes made.
Detailed Analysis
Evidence
Verification
Root Cause
localeEmojis in assets/emojis/index.ts is initialized as {en: undefined, es: undefined}. The new buildEmojisTrie logic checks if (!localeEmojis[locale]) -- since the locale data starts as undefined, this condition is always true on the first call. The function then kicks off importEmojiLocale(locale) (an async dynamic import), and immediately returns without building the trie. There is no .then(() => buildEmojisTrie(locale)) chained to that promise, so once the locale data finishes loading, the trie is never actually constructed. As a result, getEmojiTrie() returns undefined on every call until the locale data has been loaded AND buildEmojisTrie is called a second time, which never happens automatically. The replaceEmojis function in EmojiUtils.tsx exits early when the trie is undefined, leaving the shortcode text unreplaced.
MelvinBot commentedon Apr 9, 2026
Proposal
What is the root cause of that problem?
PR #87253 deferred the emoji trie build from app startup to first use. The problem is in
src/libs/EmojiTrie.ts:116-131: whengetEmojiTrieis called for the first time,localeEmojis[locale]is stillundefined(the locale data hasn't been dynamically imported yet).buildEmojisTriefiresimportEmojiLocale(locale)asynchronously but returns immediately without building the trie. The.then()callback only ends a telemetry span — it never callsbuildEmojisTrieagain after the import completes.As a result,
getEmojiTriereturnsundefined, andreplaceEmojisatsrc/libs/EmojiUtils.tsx:397-400bails out, returning the original text with:thumbsup:unmodified.What changes do you think we should make in order to solve the problem?
In
buildEmojisTrie(src/libs/EmojiTrie.ts:127-129), the.then()callback afterimportEmojiLocaleshould actually build the trie once the import resolves:However, this alone doesn't fix the first call to
replaceEmojis— the trie won't exist yet during that synchronous call. To fully fix this, the import should also be triggered earlier so the locale data is ready before the user types. This could be done by callingimportEmojiLocaleinLocaleContextProvideron locale change (as it was before the PR), while still deferring the expensive trie construction to first use.What alternative solutions did you explore? (Optional)
replaceEmojisasync — would require changes to all callers and the message sending pipeline, which is too invasive.LocaleContextProviderwithout building the trie — best of both worlds: the dynamic import starts eagerly (so data is ready), but the trie build stays lazy. This is the recommended approach.Investigation details
Data flow of the bug:
localeEmojis['en']isundefined(emoji locale data not yet dynamically imported)LocaleContextProvidereagerly calledbuildEmojisTrie, which imported locale data and built the trie before user interactiongetEmojiTrie():thumbsup:→replaceEmojis→getEmojiTrie('en')→buildEmojisTrie('en')buildEmojisTrieseeslocaleEmojis['en']isundefined, fires asyncimportEmojiLocale('en'), returns immediatelygetEmojiTriereturnsundefined→replaceEmojisreturns original text unchangedreplaceEmojisKey code locations:
src/libs/EmojiTrie.ts:122-131— early return without building trie when locale data not loadedsrc/libs/EmojiTrie.ts:143-146—getEmojiTriereturnsundefinedon first callsrc/libs/EmojiUtils.tsx:397-400—replaceEmojisbails out when trie isundefinedassets/emojis/index.ts—localeEmojisinitialized with all values asundefinedNext Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.elirangoshen commentedon Apr 9, 2026
Ok Im working on it and would update asap
elirangoshen commentedon Apr 9, 2026
I suspect that its not regression:
The emoji's name is +1, not
:thumbsup:.:thumbsup:is only a keyword (for search/suggestions).also in prod 👍 is not giving any emoji so i think that the qa test is might be wrong
more technical info :
Our codebase only has one name per emoji (the primary), and thumbsup is only a keyword for search. GitHub for example maintains an alias list where multiple shortcodes map to the same emoji.- which explain why the review might thinks we missing this - but its not issue seems it was like this before. if you want I can open pr to add this one to our list so it will be supported ?Julesssss commentedon Apr 9, 2026
Yes I think this might be a missunderstanding of the test case here. +1 is being replaced correctly