Repository navigation
Remove a frequentlyUsedEmojis value that is not a list from the local cache - #107639
Conversation
|
@linhvovan29546 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] |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
(Vit's agent) @MelvinBot review |
|
🤖 Web test steps verification results: Code review found no blocking issues; all three migration unit tests passed. Browser testing confirmed sign-in, but the remaining checks were blocked by tool limitations—not observed product failures.
|
|
|
||
| // A migration runs before the app starts, so it writes to Onyx directly instead of through an action | ||
| // eslint-disable-next-line rulesdir/prefer-actions-set-data | ||
| await Onyx.set(ONYXKEYS.FREQUENTLY_USED_EMOJIS, null); |
There was a problem hiding this comment.
NAB - Could we reformat the value instead (assuming it's not an empty object)?
There was a problem hiding this comment.
I think it will be overwritten by what comes from OpenApp eitherway
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.53-0 🚀
|
|
No help site update needed — this PR fixes a corrupted local cache so frequently used emojis update as expected; it adds no new workflow and makes no existing article inaccurate. |
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.5.53-3 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
Between Nov 2 and Nov 10,
OpenAppsent{}for accounts with noexpensify_frequentlyUsedEmojisNVP. Onyx coerced the cached[]into{}, so those devices now store an object fornvp_expensify_frequentlyUsedEmojis. Send an empty frequentlyUsedEmojis NVP as a list in OpenApp made the server send[]again, but Onyx refuses to write a list over an object. EachOpenAppandReconnectAppon those devices now logsTrying to apply "merge" with array type to non-array type in the key "nvp_expensify_frequentlyUsedEmojis"(about 75,000 a day). Those devices also never receive the user's emoji list, so the Frequently used section in the emoji picker stops updating.This PR adds the
RemoveNonArrayFrequentlyUsedEmojisOnyx migration. When the cached value is set and is not a list, the migration removes it. The next list from the server is then stored: a fullOpenApporReconnectApp, or thesetthat Auth sends when the user next uses an emoji. An incrementalReconnectAppdoes not resend the list. Until a list arrives, the picker shows the same empty Frequently used section it shows today with{}. These accounts had no emoji NVP when{}arrived, so no saved emojis are lost. Devices that already store a list, or nothing, are not changed. The migration is temporary and can be removed once those caches have refreshed.Fixed Issues
$ #104824
PROPOSAL:
Tests
tests/unit/RemoveNonArrayFrequentlyUsedEmojisTest.tscovers an object, a list, and a missing value. Without the migration, the object test fails because the merged list is rejected and the value stays{}.Onyx.set('nvp_expensify_frequentlyUsedEmojis', null).then(() => Onyx.set('nvp_expensify_frequentlyUsedEmojis', {}))to put the device in the broken state.Onyx.log('nvp_expensify_frequentlyUsedEmojis')and verify that it prints{}.Onyx.log('nvp_expensify_frequentlyUsedEmojis')and verify that it prints a list orundefined, not{}.Onyx.log('nvp_expensify_frequentlyUsedEmojis')and verify that the list includes that emoji.Trying to apply "set" with array type to non-array typeorTrying to apply "merge" with array type to non-array typewarning fornvp_expensify_frequentlyUsedEmojis.Offline tests
Onyx.set('nvp_expensify_frequentlyUsedEmojis', null).then(() => Onyx.set('nvp_expensify_frequentlyUsedEmojis', {})).Onyx.log('nvp_expensify_frequentlyUsedEmojis')and verify that it printsundefined, not{}.Onyx.log('nvp_expensify_frequentlyUsedEmojis')and verify that the list includes that emoji.QA Steps
Same as tests, on web staging.
window.Onyxis not available on native, so QA can only set up the broken state on web.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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
Not yet tested — needs manual QA.
Android: mWeb Chrome
Not yet tested — needs manual QA.
iOS: Native
Not yet tested — needs manual QA.
iOS: mWeb Safari
Not yet tested — needs manual QA.
MacOS: Chrome / Safari
Not yet tested — needs manual QA.