Skip to content
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

Search - Second saved search name order with an edited filter differs #49223

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 15, 2024 · 7 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@IuliiaHerets
Copy link

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: 9.0.35-0
Reproducible in staging?: Y
Reproducible in production?: N/A - new feature, doesn't exist in prod
Issue was found when executing this PR: #48566
Issue reported by: Applause Internal Team

Action Performed:

  1. Log in with a Gmail account with a lot of expenses
  2. Click on "Search"
  3. Click on "Filters"
  4. Click on "Merchant"
  5. Type "a" and click on the "Save" button
  6. Click on "Save search"
  7. Click on "Filters"
  8. Click on "Merchant"
  9. Replace "a" with "b"
  10. Click on "Save search"

Expected Result:

The name order should be "type status merchant" to match the original one.

Actual Result:

Second saved search name order with an edited filter differs from the original one. It's displayed as: "merchant type status".

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6604102_1726380933961.bandicam_2024-09-15_08-05-46-169.mp4

Bug6604102_1726380933968!Capture

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 15, 2024
Copy link

melvin-bot bot commented Sep 15, 2024

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.

Copy link

melvin-bot bot commented Sep 15, 2024

Triggered auto assignment to @iwiznia (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 15, 2024
@melvin-bot melvin-bot bot removed the Hourly KSv2 label Sep 15, 2024
Copy link
Contributor

👋 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:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@huult
Copy link
Contributor

huult commented Sep 15, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Second saved search name order with an edited filter differs

What is the root cause of that problem?

The values of TYPE and STATUS are set after the remaining values, such as Merchant.

App/src/libs/SearchUtils.ts

Lines 674 to 675 in 0c618ac

filtersForm[FILTER_KEYS.TYPE] = queryJSON.type;
filtersForm[FILTER_KEYS.STATUS] = queryJSON.status;

What changes do you think we should make in order to solve the problem?

We should set the values of TYPE and STATUS before the remaining filter keys.

Move filtersForm[FILTER_KEYS.TYPE] = queryJSON.type; and filtersForm[FILTER_KEYS.STATUS] = queryJSON.status; from L674 to L635 so that TYPE and STATUS are set before the remaining keys

What alternative solutions did you explore? (Optional)

we will update the filter name and input query before saving the search

// .src/libs/actions/Search.ts#L55
function saveSearch({queryJSON, name}: {queryJSON: SearchQueryJSON; name?: string}) {
-  const saveSearchName = name ?? queryJSON?.inputQuery ?? '';
+    let saveSearchName = '';
+    if (name) {
+        saveSearchName = name;
+    } else if (queryJSON?.inputQuery) {
+       const name = SearchUtils.getSearchHeaderTitle(queryJSON);
+                saveSearchName = name;
+    }

-    const jsonQuery = JSON.stringify(queryJSON);
+    const jsonQuery = JSON.stringify({...queryJSON, inputQuery: SearchUtils.getSearchHeaderTitle(queryJSON)});

    API.write(WRITE_COMMANDS.SAVE_SEARCH, {jsonQuery, name: saveSearchName});
}
POC
Screen.Recording.2024-09-15.at.23.17.30.mp4

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 15, 2024
@luacmartins
Copy link
Contributor

This is not a blocker. We sort those based on the order in which they were created. We can close this for now and reopen if we decide to sort them alphabetically.

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Sep 15, 2024
@luacmartins luacmartins assigned lakchote and luacmartins and unassigned iwiznia Sep 15, 2024
@huult
Copy link
Contributor

huult commented Sep 16, 2024

Note: in this ticket, if we don't update the filter name on the left side, we will have an issue with inconsistent filter names, as shown in the image below.
Screenshot 2024-09-16 at 09 35 43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

6 participants