Description
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:
- Refining useSearchHighlightAndScroll to handle only UI tasks (highlighting and scrolling)
- 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
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]Reducing Search API Calls in Reports Screen[/-][+][$250] Reducing Search API Calls in Reports Screen[/+]melvin-bot commentedon Apr 29, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021917145585218173680
melvin-bot commentedon Apr 29, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 (
External)melvin-bot commentedon Apr 29, 2025
Current assignee @mountiny is eligible for the AutoAssignerNewDotQuality assigner, not assigning anyone new.
86 remaining items
c3024 commentedon Jun 11, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: This is an optimization to remove redundant Search API calls. No PR is an offending PR here.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: Not critical enough to warrant a discussion.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/510577
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
melvin-bot commentedon Jun 11, 2025
Payment Summary
Upwork Job
BugZero Checklist (@JmillsExpensify)
JmillsExpensify commentedon Jun 11, 2025
Payment summary: $250 to @c3024 via NewDot.
Christinadobrzyn commentedon Jun 11, 2025
Hey @mountiny @c3024 - the payment summary in the title of this email says payment should be $125 but it looks like you requested $250. What is the amount that should be paid for this job?
c3024 commentedon Jun 12, 2025
@Christinadobrzyn
I haven't requested anything yet on ND. @JmillsExpensify just posted the payment summary. You updated the amount to $125 in the title because the PR was reverted once. This was a tricky PR, so not all regressions could be identified during the C+ review, even with careful testing. Therefore, @mountiny suggested paying the full amount of $250.
Thanks!
[-][Due for payment 2025-06-11] [$125] Reducing Search API Calls in Reports Screen[/-][+][Due for payment 2025-06-11] [$250] Reducing Search API Calls in Reports Screen[/+]melvin-bot commentedon Jun 12, 2025
Upwork job price has been updated to $250
Christinadobrzyn commentedon Jun 12, 2025
Ah, thank you so much @c3024! I really appreciate the summary! Ok awesome, I updated the GH title to the $250.
Payment summary here #61053 (comment)
Regression test here - #61053 (comment)
@c3024 please make sure to request payment via ND. TY!
garrettmknight commentedon Jul 2, 2025
Payment summary: $250 to @c3024 via NewDot.
JmillsExpensify commentedon Jul 2, 2025
$250 approved for @c3024
QichenZhu commentedon Aug 25, 2026
We still encountered a similar issue as the fix for this issue didn't fully address the problem (see details), so we've made further fixes in PRs #98558 and #98752.