fix: incorrect format of search query string#58362
Conversation
|
@dominictb Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@dominictb I'm currently experiencing 429 errors when trying to login, I'll upload the missing screenshots later when the error is gone. |
|
All the screenshots are uploaded. |
| }); | ||
|
|
||
| expect(result).toEqual(`${defaultQuery} from:9876,87654 to:78901 amount:15000 hello test`); | ||
| describe('buildQueryStringFromFilterFormValues', () => { |
There was a problem hiding this comment.
@daledah Can you add another test case: should filter out empty values so the query contains no redundant spaces
There was a problem hiding this comment.
And another case: should trim redundant zero decimals from amount
There was a problem hiding this comment.
I think empty values are filtered out before the logics are called, so we need to test a different function here.
Zero decimals IMO are not trimmed by default, as we use cents in currency values.
|
@daledah Please update the second step in your That's enough to reproduce the issue. |
|
Also as per OP:
We have just fixed the spacing bug, the additional zeros bug has not: |
|
@dominictb I believe it's a BE bug, when the query string is too long the BE seems to cut short the name string:
You can see the date filters are cut off. This behavior makes the name and query is not equal, and the following logic is not triggered: App/src/pages/Search/SearchTypeMenu.tsx Lines 74 to 78 in 11e2e5e So the name of the query will not be parsed to user readable values. cc @blimpich - Is this behavior expected in the BE? |
|
Ah yeah that does seem like a backend bug. I'm not super familiar with that part of the backend. @daledah After what action/call does the backend make the data get cut off? Is it after calling the |
|
@blimpich Yes that's correct |
|
cc: @lakchote since you wrote the SaveSearch command, can you confirm if this is a BE bug? We shouldn't be cutting the date filters off short correct? |
To confirm if this is BE related or not, @daledah could you please give the value of the The |
|
@lakchote Here's the request param for
And here's the response:
|
Thank you. This is indeed BE related. I've created an issue and assigned myself to it. |
|
Thank you Lucien!! |
|
@lakchote Keep us up to date when that PR is done. Thanks! |
|
PR was merged. Will get deployed to staging on Monday and to production on Tuesday 👍 |
|
The query name trimming issue seems resolved on staging. I'll proceed checklist and review this PR anyway. |
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeScreen.Recording.2025-03-27.at.22.31.36.moviOS: NativeScreen.Recording.2025-03-27.at.22.26.16.moviOS: mWeb SafariScreen.Recording.2025-03-27.at.22.28.05.mov |
|
@daledah Screen.Recording.2025-03-25.at.14.41.44.mov |
|
|
|
FYI the backend fix is deployed to production now 👍 |
@dominictb This bug appears on production as well: Screen.Recording.2025-03-27.at.21.41.10.mov
We only apply the fix to before saving the search. I don't think there's any logics to modify existing saved searches other than its name at the moment, changing the filters will only create new saved search. |
Reported this bug on Slack here |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.1.21-0 🚀
|
|
@izarutskaya You can select only the after date and bigger and smaller total value. It should not have any errors. |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.21-3 🚀
|









Explanation of Change
Fixed Issues
$ #57696
PROPOSAL: #57696 (comment)
Tests
DateandTotalOffline tests
QA Steps
DateandTotalPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2025-03-13.at.18.05.22.mov
Android: mWeb Chrome
Screen.Recording.2025-03-13.at.20.37.53.mov
iOS: Native
Screen.Recording.2025-03-13.at.18.02.00.mov
iOS: mWeb Safari
Screen.Recording.2025-03-13.at.18.03.25.mov
MacOS: Chrome / Safari
Screen.Recording.2025-03-13.at.20.35.55.mov
MacOS: Desktop
Screen.Recording.2025-03-13.at.18.04.08.mov