[No QA] Avoid building archived reports ID set in useDeleteTransactions - #94154
Conversation
|
@ZhenjaHorbach 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-06-22.16.04.42.movAndroid: mWeb Chrome2026-06-22.16.06.05.moviOS: HybridApp2026-06-22.16.04.42.moviOS: mWeb Safari2026-06-22.16.06.05.movMacOS: Chrome / Safari2026-06-22.16.02.56.mov |
|
🚧 @mountiny 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.17-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 I reviewed the changes in this PR against Expensify's help site files under No help site changes are required. This PR is a pure internal performance refactor of The PR description itself confirms behavior is identical — no user-facing feature, setting, label, flow, or UI element changes. The help site documents product behavior and end-user workflows, none of which are affected by this internal optimization. There is nothing to add, update, or remove in Since no help site updates are needed, I have not created a draft PR. If you believe a doc change is warranted, reply with the specifics and I'll draft one. |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀
|
1 similar comment
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.17-3 🚀
|
Explanation of Change
useDeleteTransactionspreviously calleduseArchivedReportsIDSet(), which invokesbuildArchivedReportsIDSetand iterates over every report's name-value-pairs entry to build aSeton each render. For large accounts (~100k reports) this is a full O(n) sweep on every render.The set was only used for a single lookup — checking whether the chat IOU report is archived. Replaced the upfront set build with a direct
isArchivedReportcall on the single NVP entry for that report:isArchivedReport(allReportNameValuePairs?.[REPORT_NAME_VALUE_PAIRS + chatIOUReportID]).The hook already subscribes to
ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, so no new Onyx subscription is added anduseArchivedReportsIDSetis dropped entirely. Behavior is identical:buildArchivedReportsIDSetadds a key iffisArchivedReport(nvp)is true, andisReportArchivedByIDjust checks membership — so callingisArchivedReportdirectly on the same NVP entry yields the same boolean (both returnfalsefor missing reports).Fixed Issues
$ #94169
PROPOSAL:
Tests
No tests needed, pure refactor
Offline tests
N/A
QA Steps
Same as tests
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari