Repository navigation
perf: Narrow Search snapshot subscriptions to loading actions and task name-value pairs - #104736
Conversation
9ef42d9 to
7cf1eb2
Compare
|
@hoangzinh 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 SummaryThis 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. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-10-23.at.21.14.33.movAndroid: mWeb ChromeScreen.Recording.2026-10-23.at.20.19.59.moviOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-10-23.at.20.17.43.movScreen.Recording.2026-10-23.at.20.16.26.mov |
| } | ||
| } | ||
| function useActionLoadingReportIDs(): ReadonlySet<string> { | ||
| const [actionLoadingReportKeys] = useOnyx(ONYXKEYS.COLLECTION.RAM_ONLY_REPORT_LOADING_STATE, {selector: actionLoadingReportKeysSelector}); |
There was a problem hiding this comment.
I considered whether this violates PERF-11 rule. However, in the worst case, user does bulk action with 50 items is still not a large object.
To filter/map entire collections into arrays — the output is still large, deepEqual still expensive
Ref: https://github.com/Expensify/App/blob/main/.claude/skills/app-coding-standards/rules/perf-11-optimize-data-selection.md#L26
There was a problem hiding this comment.
hmmm RAM_ONLY_REPORT_LOADING_STATE accumulates reports in the session no? So this could potentially be large.
It would be good if we could track if this is slowing things down.
|
@TMisiukiewicz Can you update this "Go to Reports > Approve" to "Go to Spends > Needs approval" in Test steps |
|
@hoangzinh done! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 rlinoz 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/rlinoz in version: 9.5.21-0 🚀
|
|
No help site update needed. This PR only reduces unnecessary re-renders in Search, so users see no change in features, labels, or behavior. |
|
🚀 Deployed to staging by https://github.com/rlinoz in version: 9.5.23-0 🚀
|
|
No help site update needed. This PR only reduces unnecessary re-renders in Search, so users see no change in features, labels, or behavior. |
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.5.23-3 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
useActionLoadingReportIDsnow selects only the report keys withisActionLoading. Before, any flag in the loading-state collection (such asisLoadingInitialReportActionsfromOpenReport) produced a newSet, and Search rebuilt every row.useSearchSnapshotnow passes report name-value pairs togetSectionsonly for task searches, the only path that reads them (parent archived check ingetTaskSections). Writes to them when a report opens no longer recompute sections on the other to-do searches.Fixed Issues
$ #104742
PROPOSAL:
Tests
Row action in flight
Opening a report from a to-do
Tasks with an archived parent
Offline tests
Same as 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