Skip to content

[Due for payment 2025-06-11] [$250] Reducing Search API Calls in Reports Screen #61053

Description

@mountiny

Coming from this proposal.

Background:

When users open an expense report from the "Reports" tab, the application displays the detailed report information. Currently, the useSearchHighlightAndScroll hook is doing more than what its name suggests - beyond just handling UI highlighting and scrolling functions, it's also making API calls to the /Search endpoint. Hooks should ideally have single responsibilities that match their names, but this hook is currently performing data fetching operations that lie outside its intended purpose.

Problem:

When a user opens an expense report, multiple redundant calls to the /Search endpoint are triggered (by useSearchHighlightAndScroll hook), wasting network resources and impacting application performance.

Solution:
We will separate the concerns by:

  1. Refining useSearchHighlightAndScroll to handle only UI tasks (highlighting and scrolling)
  2. Creating a new useSearchPusherUpdates hook in Search/index.tsx to handle Pusher update events and make /Search API calls only when necessary

This separation will maintain functionality while reducing network overhead and improving performance.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021917145585218173680
  • Upwork Job ID: 1917145585218173680
  • Last Price Increase: 2025-06-12
Issue OwnerCurrent Issue Owner: @JmillsExpensify / @Christinadobrzyn

Activity

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

Metadata

Metadata

Labels

AutoAssignerNewDotQualityUsed to assign quality issues to engineersAwaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions