You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Search - Second saved search name order with an edited filter differs #49223
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:
Log in with a Gmail account with a lot of expenses
Click on "Search"
Click on "Filters"
Click on "Merchant"
Type "a" and click on the "Save" button
Click on "Save search"
Click on "Filters"
Click on "Merchant"
Replace "a" with "b"
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".
👋 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:
Identify the pull request that introduced this issue and revert it.
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});
}
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.
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.
Activity
melvin-bot commentedon 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.melvin-bot commentedon Sep 15, 2024
Triggered auto assignment to @iwiznia (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon Sep 15, 2024
👋 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:
IuliiaHerets commentedon Sep 15, 2024
We think that this bug might be related to #wave-collect - Release 1
huult commentedon 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
TYPEandSTATUSare set after the remaining values, such as Merchant.App/src/libs/SearchUtils.ts
Lines 674 to 675 in 0c618ac
What changes do you think we should make in order to solve the problem?
We should set the values of
TYPEandSTATUSbefore the remaining filter keys.Move
filtersForm[FILTER_KEYS.TYPE] = queryJSON.type;andfiltersForm[FILTER_KEYS.STATUS] = queryJSON.status;from L674 to L635 so thatTYPEandSTATUSare set before the remaining keysWhat 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}); }Details
POCScreen.Recording.2024-09-15.at.23.17.30.mp4
luacmartins commentedon Sep 15, 2024
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.
huult commentedon 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.
