Repository navigation
[Due for payment 2026-08-07] Skip report name recompute for badge-only policy changes in reportAttributes #97095
Description
Activity
- addedReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2DailyKSv2KSv2and removedReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2
on Jul 27, 2026 - changed the title
[-]Skip report name recompute for badge-only policy changes in reportAttributes[/-][+][Due for payment 2026-08-07] Skip report name recompute for badge-only policy changes in reportAttributes[/+]on Jul 31, 2026 The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.46-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-08-07. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
- addedAwaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to production
on Jul 31, 2026 Auto-assign attempt failed, all eligible assignees are OOO.
@situchan Whoops! This issue is 2 days overdue. Let's get this updated quick!
Perf issue. No need regression test
Payment Summary
Resolving PRs:
-
Skip report name recompute for badge-only policy changes in reportAttributes #97093
-
Contributor: @TMisiukiewicz does not require payment (Contractor)
-
Reviewer: @situchan owed $250 via NewDot
BugZero Checklist (@mallenexpensify)
- I have confirmed assignees, roles, and Upwork contracts look correct
- I have paid out Upwork contracts / manual NewDot requests
-
Payment Summary
Contributor+: @situchan due $250 via NewDot
laurenreidexpensify commented
on Sep 3, 2026 ContributorMore actions$250 approved @situchan New Expensify
Problem
Opening the Spend tab for the first time fires
OpenSearchPage, whose server response merges the fullpolicy_collection (5.6k policies on large accounts).getCollectionDeltais a reference-equality scan, so the merge surfaces nearly all policies as "changed" andreportAttributesrecomputedcomputeReportNamefor ~8245 reports — causing a ~30s main-thread hang. Report names only depend onpolicy.name/achAccount, not the badge-relevant fields (type,approvalMode,reimbursementChoice, etc.) thathasPolicyRelevantFieldChangedtracks, so this was wasted work.Solution
Skip
computeReportNamefor reports pulled into the pass solely by badge-only policy changes — they reuse their cached name while badges still recompute. Names are only recomputed when a name-affecting source changes (report/action/nvp/personal-details/transaction/policy-tags updates) or when a policy'snameorachAccountactually changed. Also seeds thepreviousPoliciesvalue-baseline on the startup flush so the first policy trigger has a real baseline to diff against. Reduces Spend tab open time from ~30s to ~5s on throttled CPU.PR
#97093
Issue Owner
Current Issue Owner: @mallenexpensify