Repository navigation
Lazy-load contact options: shell first, createOption after getValidOptions - #97087
mjasikowski merged 50 commits into
Conversation
…ter and rank fields
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.
|
1768c07 to
ea82e46
Compare
Co-authored-by: Dariusz Biela <dariusz.biela.dev@gmail.com>
e97859e to
6ac089c
Compare
46770d0 to
44ca202
Compare
|
|
|
@jmgraa need to resolve conflicts |
|
It seems the tests are failing because of a |
|
PR doesn’t need product input as a performance PR. Unassigning and unsubscribing myself. |
|
@mjasikowski conflicts resolved |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
🚧 mjasikowski 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/mjasikowski in version: 9.4.56-0 🚀
|
|
🤖 No help site changes required. I reviewed this PR against the help site articles under Why: This is a purely internal performance optimization. It changes how contact/participant options are built — emitting lightweight Callers of Because no changes are required, I did not create a draft help site PR. @jmgraa, no help site PR was created since this PR introduces no user-facing behavior changes. If you believe a doc update is warranted, let me know what behavior you'd like documented and I'll draft one. |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.56-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
On large accounts, building a full
createOptionfor every personal detail is expensive (policy/tag/archive lookups, icons, etc.), even though most contacts are discarded by filtering/ranking.This PR changes contact option construction so
createFilteredOptionListalways emits lightweightPersonalDetailShells instead of fully built options. Shells only carry the fields needed to filter, rank, and de-dupe (text,login,accountID,participantsList, etc.), plus anisHydrated: falsediscriminant and a memoizedhydrate()that runsbuildFullOption/createOptionon demand. Display fields are not readable on a shell without narrowing onisHydrated.How it works:
createFilteredOptionList/buildPersonalDetailsOptions.getValidOptions, filter and rank on those shells, then hydrate only the top-N survivors withhydrateContactOption. Contacts that never make the cut never pay the fullcreateOptioncost.Callers of
getValidOptions/getSearchOptionsstill receive fully built personal-detail options; the lazy work is internal to the option-list pipeline.hydrateContactOptionremains available for any shell that still needs hydration outside that path (e.g. tests or draft restore).Unit tests check that shells match fully built options for filtering and sorting, and that after hydration the final results match the previous eager path (including search, exclusions, and top-N limits).
ParticipantSearchResults / createFilteredOptionList
Fixed Issues
$ #97788
PROPOSAL:
Tests
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari