Skip to content

[Due for payment 2026-06-30] [Payment due @ZhenjaHorbach] [No QA] Avoid building archived reports ID set in Search getSections pipeline #94193

Description

@mountiny

Problem

The Search getSections pipeline (Search/index.tsx and useSearchSections.ts) used useArchivedReportsIDSet(), which subscribed to the entire REPORT_NAME_VALUE_PAIRS collection and rebuilt a Set via an O(n) Object.entries scan on every collection change — for every search type. This was wasteful because getSections only needs a single report's archived status, and only for task searches.

Solution

Removed useArchivedReportsIDSet() from the Search pipeline. Components now pass the raw reportNameValuePairs collection into getSections/getTaskSections, which calls isArchivedReport(reportNameValuePairs?.[key]) directly (O(1) lookup) where needed. Same data source and coverage as before; the eager Set construction is eliminated.

PR

#94182

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 productionDailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions