-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$250] [HOLD for payment 2024-11-14] [Search v2.4] - Same search query appears twice in Recent searches #51044
Comments
Triggered auto assignment to @dangrous ( |
💬 A slack conversation has been started in #expensify-open-source |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
We think that this bug might be related to #wave-control |
ProposalPlease re-state the problem that we are trying to solve in this issue.Same search query appears twice in Recent searches What is the root cause of that problem?When we search again, new entry is added to nvp_RecentSearches What changes do you think we should make in order to solve the problem?Add logic to remove duplicate queries and keep only most recent one in below line.
|
FYI, It happens because we don't use sort related properties when making the search header in below code. So, we essentially ignore sort by, sort order and policy id from the query. Lines 812 to 815 in 91c6e0c
|
@luacmartins do you want to take this one since you know the search stuff well? |
I'd like to work on it, since I was implementing Search 2.4. |
@SzymczakJ all yours. I think we can demote this to NAB since it doesn't really break any functionality. |
This bug is on FE
but after investigating this I think that it should be also fixed on BE. Recent Searches are generated on BE after searching for query. In case when we are searching for the same query twice, then it should be renewed in history and not duplicated. WDYT @luacmartins |
@SzymczakJ that is the current logic in the backend. As you can see the Onyx data is accurate, not sure why the Onyx data and the list are out of sync |
Oh I see that it shows the query because we have instances of the same query saved with and without |
@luacmartins I agree, I commented here: #50921 (comment). Adding that on the frontend when sending it back to the server will fix the bug for this case. However, it will not resolve the issue in cases of the same query with different sortBy or sortOrder. In this comment, I suggested filtering the recent searches based on a secondary hash. |
Hmm in the case of different sortBy or sortOrder (that's not the default), wouldn't we want to display that to the user, which would make it a different recent search? After all, they'd have to explicitly set those to values other than the default. |
@luacmartins @SzymczakJ What do you think about this plan:
Lines 738 to 746 in 793dcaf
App/src/pages/Search/SearchTypeMenu.tsx Line 118 in 41ed362
and here:
and keep using
App/src/pages/Search/SearchAdvancedFiltersPage.tsx Lines 21 to 23 in 41ed362
|
A few things we'd need to check.
So while this is one possible course of action, we'd need to verify if above cases don't break. Especially about point 1 - please remind me, we have never used hash as onyx key in front right? I imagined that? 😅 Now about what @SzymczakJ was trying to convey I think is this: So basically for the user let's not save the same exact query that differs only by sorting. In general we would like to avoid
IMO ☝️ looks not really helpful. I'd rather see my actual older searches than the same search with changed sorts. |
I think we have to include sortOrder and sortBy in hash because:
Also, fixing this on BE would be a problem, so I think the only solution we have is to have two hashes, one for computing recentSearches(which doesn't include sortOrder and sortBy) and the other one for everything else(this hash would include sort). @rayane-djouah proposed it in #51044 (comment). |
Yea, I think the simplest solution would be to have two hashes. We could add
I like just adding the |
Agreed that in the current situation storing two hashes seems the most reasonable 👍 Feels to me like:
|
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.58-2 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-11-14. 🎊 For reference, here are some details about the assignees on this issue:
|
Issue is ready for payment but no BZ is assigned. @johncschuster you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks! |
Payment Summary
BugZero Checklist (@johncschuster)
|
Job added to Upwork: https://www.upwork.com/jobs/~021857076660400822469 |
Current assignee @rayane-djouah is eligible for the External assigner, not assigning anyone new. |
Payment Summary: Contributor: @SzymczakJ does not require payment Upwork job here! Please apply |
@johncschuster Offer accepted, Thanks! |
Payment has been issued! Thanks for your contributions! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.50-3
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team
Action Performed:
Precondition:
Expected Result:
The search query made in Step 4 will only appear once after clicking on the same search query again in Step 7
Actual Result:
The search query made in Step 4 appears twice after clicking on the same search query again in Step 7
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6637920_1729183854749.bandicam_2024-10-18_00-47-35-359.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @The text was updated successfully, but these errors were encountered: