Perf: skip reportAttributes full recompute on initial locale load#83828
Conversation
| import type {PersonalDetailsList, ReportAttributesDerivedValue} from '@src/types/onyx'; | ||
|
|
||
| let isFullyComputed = false; | ||
| let isFullyComputed = true; |
There was a problem hiding this comment.
this should be documented with a comment
There was a problem hiding this comment.
added comment, as requested
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
No product review needed |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp83828_android_native.movAndroid: mWeb ChromeiOS: HybridApp83828_ios_native.moviOS: mWeb SafariMacOS: Chrome / Safari83828_web_chrome.mov |
|
Sorry for the delay. @sosek108, when I reload the app (iOS Native) for a second, the translations don't seem to load: Screen.Recording.2026-03-16.at.09.54.25.movIn the main menu it seems ok: Screen.Recording.2026-03-16.at.09.56.52.movCan you reproduce it? Thank you. |
|
@brunovjk Hi, I can reproduce this on both I think that on production this is hidden by loading splash screen which is not visible on |
Thank for clarifying. I will check now, bit I think is everything ok than |
|
I've fixed CI checks problems. |
|
🚧 @NikkiWines 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/NikkiWines in version: 9.3.41-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.41-4 🚀
|


Explanation of Change
On cold start,
reportAttributeswas performing a full recompute over all reports when the preferred locale key first arrived from Onyx. This was unnecessary because:isFullyComputed = trueso startup defaults to incremental update modepreviousLocaleguard: only resetisFullyComputed = falseon locale changes when a previous locale was already set (!!previousLocale). The very first locale load is skippedpreviousLocaleassignment to only update whenpreferredLocaleis truthy, preventing a null value from masking a subsequent real locale changeFixed Issues
$ #83043
PROPOSAL:
Tests
!!previousLocaleguard)Offline tests
N/A
QA Steps
Prerequisites: have two different account where you can easily check if report's names are correct.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Android: mWeb Chrome
iOS: Native
Nagranie.z.ekranu.2026-03-6.o.09.12.07.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-03-6.o.09.10.05.mov