Problem
useDeleteTransactions called useArchivedReportsIDSet(), which runs buildArchivedReportsIDSet and iterates over every report's name-value-pairs entry to build a Set on each render. For large accounts (~100k reports) this is a full O(n) sweep on every render, even though the set was only used for a single lookup — checking whether the chat IOU report is archived.
Solution
Removed useArchivedReportsIDSet and replaced the upfront set build with a direct isArchivedReport call on the single NVP entry for the chat IOU 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 and behavior is identical.
PR
#94154
Issue Owner
Current Issue Owner: @mallenexpensify
Problem
useDeleteTransactionscalleduseArchivedReportsIDSet(), which runsbuildArchivedReportsIDSetand 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, even though the set was only used for a single lookup — checking whether the chat IOU report is archived.Solution
Removed
useArchivedReportsIDSetand replaced the upfront set build with a directisArchivedReportcall on the single NVP entry for the chat IOU report:isArchivedReport(allReportNameValuePairs?.[REPORT_NAME_VALUE_PAIRS + chatIOUReportID]). The hook already subscribes toONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, so no new Onyx subscription is added and behavior is identical.PR
#94154
Issue Owner
Current Issue Owner: @mallenexpensify