Repository navigation
[NO QA] Fix LHN full scan triggered by empty updatedReports during reportAttributes hydration - #83588
Conversation
|
CLA check is failing, but I don't know why |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d389f4c0d4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
No product review needed |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppNA Android: mWeb ChromeNA iOS: HybridAppNA iOS: mWeb SafariNA MacOS: Chrome / Safari83588-web-chrome-001.mp4 |
rojiphil
left a comment
There was a problem hiding this comment.
@Julesssss Changes LGTM.
NikkiWines
left a comment
There was a problem hiding this comment.
one small style request 🙇
NikkiWines
left a comment
There was a problem hiding this comment.
lgtm, all you @Julesssss
|
🚧 @Julesssss has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Julesssss in version: 9.3.31-0 🚀
|
|
@sosek108 @NikkiWines @Julesssss Can you please clarify what do we need to QA here? |
@mvtglobally no QA here, we forgot to add the note, sorry |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.31-12 🚀
|
Explanation of Change
During app startup, Onyx hydrates
reportAttributesas a whole-collection update. When this happens,getUpdatedReports()returns an empty array (no individual report keys changed), causingshouldDoIncrementalUpdateto befalseand triggering a full O(n) scan across all reports — even when the LHN cache was already populated.This fix introduces
effectiveUpdatedReports: ifupdatedReportsis empty but the cache already has entries, we use the currently-displayed report keys as the update set. This keeps the incremental code path active forreportAttributes-only changes, avoiding the expensive full scan.Additionally,
policieswas removed from thegetAllReportsToDisplayInLHNcall and from theuseMemodependency array — it was not actually consumed insidegetReportsToDisplayInLHN, so its presence was causing unnecessary re-renders with no effect.Fixed Issues
$ #83043
$ #83621
#83511
PROPOSAL:
Tests
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Nagranie.z.ekranu.2026-02-27.o.12.28.13.mov
Android: mWeb Chrome
iOS: Native
Nagranie.z.ekranu.2026-02-27.o.12.25.27.mov
iOS: mWeb Safari
MacOS: Chrome / Safari