-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[WAITING ON CHECKLIST] [$250] Multiple requests to SearchForReport
when searching for a user
#40608
Comments
Triggered auto assignment to @jliexpensify ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.What is the root cause of that problem?This is not a bug, but we can make some improvements. When the input text is changed, a new API call is made to get the new data based on the input. What changes do you think we should make in order to solve the problem?As of now, the debounce time that is being used is 300 ms. We can change it to a higher value like 400 ms or 500 ms for the report search by passing the value in Another thing can be to cancel the previous API calls when a new call is made. So, if the input text is changed and a new call is made, then all previous search API calls which haven't completed will be cancelled. This can be implemented using |
This was omitted from the issue description:
Please take it into consideration for the proposals. |
Whoop sorry, missed this one yesterday - I can repro. |
SearchForReport
when searching for a userSearchForReport
when searching for a user
Job added to Upwork: https://www.upwork.com/jobs/~01c8c8aa1341923a49 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Numerous requests to SearchForReport is sent What is the root cause of that problem?In here, we're using debouncing to update the search value, so if the user stops and continues typing after 300ms, it will result in 2 API calls. For each 300ms delay after continuing typing, there'll be an API call. What changes do you think we should make in order to solve the problem?The 300ms debounce looks too low, since it's common that the user will stop for 300ms between each word of typing. We should:
This can be done by adding the second param for the delay here Update: Since this debounced value will affect the live filtering debounce too, we might want to separate the debounceValue for The steps to do this:
Then use it in 2 places above
An alternative is we can refactor the Another simple way to do this is to use We might want to consider having no debounce for live filtering, but there might be performance issues as mentioned here.
This is because we're always waiting for the debounce value, without regards to if the user manually submits the input or not. The ideal UX in this case would be to start the search immediately after the user submits the input (eg. via Enter), because this means the user is done with typing and wants the result immediately. To do this, we need to:
Call What alternative solutions did you explore? (Optional)We can abort existing |
@ahmedGaber93 bump as we have 2 proposals |
Reviewing today. |
@ShridharGoel @tienifr Thanks for the proposal. The both proposals suggest increasing debounce time, and @tienifr proposal point 2 suggest UX changes that allow the user to submit the input to start search immediately. I think increasing debounce time to 1000ms like isUserTyping will reduce API calls, but also the live search result will be more late, but I think we can accept that for more API performance, and we're already displaying the saved data in onyx storage without needing to wait to API response. The UX changes by @tienifr proposal point 2 is not the best for @iwiznia There is another behavior appear after increasing the time, the result for the saved data in onyx storage will also debounce because filtering data depend on Screen.Recording.2024-04-25.at.7.48.39.AM.mov |
I don't think that's true, that's what leading is for: App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx Line 196 in 64695c8
Don't get why this is bad, what are the consequences of it? |
@iwiznia Filtering the data every 1000ms seem bad UX, for example, if we have 4 items
I don't think this is worth, so I asked you. |
@iwiznia I guess your response is for this part If user start typing and type first letter So I think the live search result from API will be more late than current. |
Yeah,1s might not be the best value to use as it feels quite high. |
@iwiznia I think the only available improvement right now is increasing the debounce time, can we move forward with this improvement? Or this not enough? If we can move forward, I think 500ms may be good. |
@ahmedGaber93 I believe we can avoid this by having a separate debounce time for API call (1s) and keeping the current debounce time for filtering as is (300ms, so it's interactive right after the user types). We don't have to make them the same value. Then we have the best of both worlds here. What do you think? |
Sounds good. Still not sure if 1s is the best number... doing some live tests will probably help out to know. |
@iwiznia Since the backend search API call itself now takes around 2.5s - 4s, I think "delaying calling the API" for an additional few hundreds milliseconds won't make a difference to real users. As long as the live search is smooth (for which we will keep the current debounce time), I think 1s is ok for the delay of the API call. |
@tienifr yes, I think you need to follow that if we decide to use long debounce time for API >= 1s. |
Triggered auto assignment to @techievivek, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@jliexpensify @techievivek @ahmedGaber93 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
Not overdue |
📣 @ahmedGaber93 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
This issue has not been updated in over 15 days. @jliexpensify, @techievivek, @ahmedGaber93, @tienifr eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
SearchForReport
when searching for a userSearchForReport
when searching for a user
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.77-11 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 2024-06-06. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Payment Summary
Just waiting on the checklist! |
Bump @ahmedGaber93 for the checklist! |
Payments made and job closed. |
SearchForReport
when searching for a userSearchForReport
when searching for a user
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
This issue is for improving performance and reduce API calls, So I think there is no offending PR, and need for regression test. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.63-11
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @iwiznia
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1713544197266279
Action Performed:
Expected Result:
Shouldn't be numerous requests to
SearchForReport
Actual Result:
Numerous requests to
SearchForReport
is sentFor proposals - see this comment:
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.2998.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @jliexpensifyThe text was updated successfully, but these errors were encountered: