Skip amount conversion for recent searches in SearchRouter#84295
Skip amount conversion for recent searches in SearchRouter#84295luacmartins merged 2 commits intomainfrom
Conversation
When selecting a recent search containing an amount filter (e.g. amount:6), the amount was being converted to backend format twice (6 → 600 → 60000). This happened because submitSearch in SearchRouter.tsx always ran amount conversion via getQueryWithUpdatedValues, even for stored queries that were already in backend format. Pass shouldSkipAmountConversion=true for non-findItem selections (recent and saved searches) to match the existing pattern in SearchPageHeaderInput. Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
| setFocusAndScrollToRight(); | ||
| } else { | ||
| submitSearch(item.searchQuery); | ||
| submitSearch(item.searchQuery, item.keyForList !== 'findItem'); |
There was a problem hiding this comment.
@MelvinBot Please put findItem into CONST and update other places to use this new CONST
There was a problem hiding this comment.
@MelvinBot Please put findItem into CONST and update other places to use this new CONST
There was a problem hiding this comment.
Done! Added FIND_ITEM to CONST.SEARCH.SEARCH_ROUTER_ITEM_TYPE and updated all 4 usages across both SearchRouter.tsx and SearchPageHeaderInput.tsx to reference the new constant.
|
@MelvinBot Mark this PR as ready for review |
|
Done! This PR has been marked as ready for review. 🤖 |
|
@MelvinBot Please put findItem into CONST and update other places to use this new CONST |
…ITEM Co-authored-by: DylanDylann <DylanDylann@users.noreply.github.com>
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-06.at.14.06.29.movAndroid: mWeb ChromeScreen.Recording.2026-03-06.at.14.05.23.moviOS: HybridAppScreen.Recording.2026-03-06.at.14.06.58.moviOS: mWeb SafariScreen.Recording.2026-03-06.at.14.04.24.movMacOS: Chrome / SafariScreen.Recording.2026-03-06.at.14.01.41.mov |
trjExpensify
left a comment
There was a problem hiding this comment.
What a weird bug!
CC: @JS00001 @luacmartins for vis
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.3.33-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.33-5 🚀
|
Explanation of Change
When selecting a recent search containing an amount filter (e.g.
amount:6) from the SearchRouter, the amount was being double-converted to backend format —6became600(correct), but then600became60000on the next selection from recent searches.This happened because
submitSearchinSearchRouter.tsxalways calledgetQueryWithUpdatedValueswithout theshouldSkipAmountConversionflag, even for stored queries that were already in backend format.This PR adds the
shouldSkipAmountConversionparameter tosubmitSearchand passestruefor non-findItemselections (recent and saved searches), matching the existing pattern already used inSearchPageHeaderInput.tsx.Fixed Issues
$ #79934
PROPOSAL: #79934 (comment)
Tests
amount:6in the search input and press Enteramount:6in the search querytype:expense amount:6entryamount:6(notamount:600)Offline tests
N/A — this change only affects query string formatting for search navigation; no network requests are modified.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Web: Chrome
Tested via Playwright browser automation. Selecting recent search "type:expense amount:6" correctly shows "amount:6" in the search bar — no double conversion to "amount:600".