Skip to content

[Due for payment 2026-10-16] Skip Search auto-refetch diff when transactions are unchanged #103443

Open

Description

@mountiny

Problem

useSearchAutoRefetch re-runs its effect on snapshot, loading, and focus changes. By then usePrevious has already caught up, so the effect diffs the full transaction collection against itself and always finds nothing. hasChangedTransactionInSearchResults also calls Object.entries(transactions) a second time, which allocates a pair for every transaction. Together these cost about 120ms per trace on a large account.

Solution

The effect now returns early when transactions and reportActions are the same references as the previous ones and no search is pending. This keeps behavior the same, because every check already evaluated to false in that case. hasChangedTransactionInSearchResults now loops over the transactionsIDs array the effect already computed. Its total time dropped from 120ms to 11ms, and ManualOpenReport dropped about 210ms (about 5%).

PR

#103436

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. changed the title [-]Skip Search auto-refetch diff when transactions are unchanged[/-] [+][Due for payment 2026-10-16] Skip Search auto-refetch diff when transactions are unchanged[/+] on Oct 9, 2026
  2. melvin-bot commented on Oct 9, 2026

    @melvin-bot

    @nkdengineer

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.6-6 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-10-16. 🎊

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]

  3. melvin-bot commented on Oct 12, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  4. nkdengineer commented on Oct 12, 2026

    @nkdengineer
    Contributor

    This is a performance issue, so there is no need for a checklist here.

  5. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  6. melvin-bot commented on Oct 15, 2026

    @melvin-bot

    @mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

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

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions