Skip to content

[Due for payment 2025-05-22] [Due for payment 2025-05-13] [$250] Reducing Search API Calls in Reports Screen #61053

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mountiny opened this issue Apr 29, 2025 · 26 comments
Assignees
Labels
AutoAssignerNewDotQuality Used to assign quality issues to engineers Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@mountiny
Copy link
Contributor

mountiny commented Apr 29, 2025

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-04-29
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@mountiny mountiny added AutoAssignerNewDotQuality Used to assign quality issues to engineers Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor labels Apr 29, 2025
@melvin-bot melvin-bot bot changed the title Reducing Search API Calls in Reports Screen [$250] Reducing Search API Calls in Reports Screen Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021917145585218173680

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 (External)

Copy link

melvin-bot bot commented Apr 29, 2025

Current assignee @mountiny is eligible for the AutoAssignerNewDotQuality assigner, not assigning anyone new.

@mountiny mountiny removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 29, 2025
Copy link

melvin-bot bot commented Apr 29, 2025

Triggered auto assignment to @Christinadobrzyn (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@ishakakkad
Copy link
Contributor

Solution is already defined in OP, I would like to work on this task if this will be done by external.

@mountiny
Copy link
Contributor Author

Thanks! Callstack will handle this

@mountiny
Copy link
Contributor Author

@martasudol lets please handle this one in one more PR #60896 (comment)

Copy link

melvin-bot bot commented May 2, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added the Overdue label May 2, 2025
Copy link

melvin-bot bot commented May 2, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@c3024
Copy link
Contributor

c3024 commented May 5, 2025

PR reverted. New PR to be opened.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Overdue Daily KSv2 labels May 5, 2025
Copy link

melvin-bot bot commented May 13, 2025

Payment Summary

Upwork Job

  • Contributor: @martasudol is from an agency-contributor and not due payment
  • Reviewer: @c3024 owed $250 via NewDot

BugZero Checklist (@Christinadobrzyn)

  • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1917145585218173680/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@c3024
Copy link
Contributor

c3024 commented May 13, 2025

@Christinadobrzyn , yes, that's correct!

@Christinadobrzyn
Copy link
Contributor

watching PR - #61499

@Christinadobrzyn
Copy link
Contributor

watching PR - #61499

Gonna move this back to weekly since the PR will still need to go through the 7 day window

@Christinadobrzyn Christinadobrzyn added Weekly KSv2 and removed Daily KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels May 15, 2025
@mountiny
Copy link
Contributor Author

Had to be reverted due to blocker unfortunately

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 15, 2025
@melvin-bot melvin-bot bot changed the title [Due for payment 2025-05-13] [$250] Reducing Search API Calls in Reports Screen [Due for payment 2025-05-22] [Due for payment 2025-05-13] [$250] Reducing Search API Calls in Reports Screen May 15, 2025
Copy link

melvin-bot bot commented May 15, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 15, 2025
Copy link

melvin-bot bot commented May 15, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.45-21 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 2025-05-22. 🎊

For reference, here are some details about the assignees on this issue:

  • @martasudol does not require payment (Contractor)
  • @c3024 requires $250 payment through NewDot Manual Requests

@Christinadobrzyn Christinadobrzyn removed the Bug Something is broken. Auto assigns a BugZero manager. label May 19, 2025
@Christinadobrzyn Christinadobrzyn removed their assignment May 19, 2025
@Christinadobrzyn Christinadobrzyn added the Bug Something is broken. Auto assigns a BugZero manager. label May 19, 2025
Copy link

melvin-bot bot commented May 19, 2025

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 19, 2025
@Christinadobrzyn
Copy link
Contributor

Just a heads up that I'm going to be ooo May 21st - May 27th. Back on the 28th.

I'll assign someone to pay this.

@c3024 do we need a regression test for this?

cc @JmillsExpensify

@Christinadobrzyn Christinadobrzyn self-assigned this May 19, 2025
@c3024
Copy link
Contributor

c3024 commented May 20, 2025

The PR was reverted, so payment is not yet due.

@martasudol
Copy link
Contributor

New PR created here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoAssignerNewDotQuality Used to assign quality issues to engineers Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: HIGH
Development

No branches or pull requests

7 participants