Skip to content

[Due for payment 2026-07-23] Scope first policy load recompute to reports referencing changed policies #95948

Description

@mountiny

Problem

The reportAttributes derived value has a "first policy load → recompute all reports" escape hatch. On app refresh, ReconnectApp merges ~1k policies while previousPolicies starts empty, forcing needsFullRecompute = true and disabling incremental updates. This re-runs the full per-report attribute pipeline for every report in the account, producing an ~11s JS-thread block on large accounts — typically as a redundant second full pass right after cold start.

Solution

Remove the full-recompute special case for first policy load and reuse the existing scoped path: only reports referencing a policy whose relevant fields actually changed are recomputed. A brand-new policy already counts as "changed" via hasPolicyRelevantFieldChanged(undefined, next), so first load is naturally covered by scoping to reports that reference the loaded policies. Also extend policy-change scoping to invoice reports whose PAY badge depends on the receiver workspace policy. This drops cost from O(all reports) to O(reports-with-a-changed-policy).

PR

#95944

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2Task

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions