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
[Due for payment 2026-09-07] Using the global search box on the Spend > Expenses page causes the Amount filter value to be multiplied by 100x. #99071
Version Number: 9.4.57-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@RachCHopkins Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Navigate to Spend > Expenses.
Add an Amount filter using Less than, Greater than, or Equal to.
Enter an amount, for example $500.
Add a keyword to the Global Search box, or reset/clear the search box.
Review the Amount filter value.
Expected Result:
The Amount filter value should remain unchanged when a keyword is added to or removed from the Global Search box.
Actual Result:
The Amount filter value is multiplied by 100x. For example, $500 changes to $50,000.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
The amount filter value is converted from dollars to cents a second time every time the keyword in the global Search box changes.
Amounts in a search query are stored in backend cents (e.g. $500 → amount>50000). When you add or clear a keyword, SearchPageInput.submitSearch rebuilds the query and calls getQueryWithUpdatedValues(queryWithContext)without the shouldSkipAmountConversion flag. That flag defaults to false, so getUpdatedFilterValue runs convertToBackendAmount (× 100) on a value that is already in cents: 50000 → 5,000,000, which displays as $50,000. Each keyword add/clear multiplies it by 100 again.
The sibling SearchRouter component already handles this correctly by threading shouldSkipAmountConversion = true — SearchPageInput is the one caller that forgot to.
Evidence / data flow
User sets Amount filter to $500 → stored in the URL query as amount>50000 (cents — the correct, first conversion).
User types/clears a keyword → onSubmitEditing / onClearInput both call submitSearch(...) (SearchPageInput.tsx:68-87).
Correct pattern for comparison: SearchRouter.submitSearch passes shouldSkipAmountConversion through because its query already holds backend amounts.
The static twin StaticSearchPageInput.tsx does not call getQueryWithUpdatedValues, so it is not affected — no additional fix needed there.
What changes do you think we should make in order to solve the problem?
In SearchPageInput.submitSearch, pass true as the second argument to getQueryWithUpdatedValues, since queryWithContext is derived from the current queryJSON whose amounts are already in backend cents:
This matches how SearchRouter and buildFilterQueryWithSortDefaults re-serialize an already-persisted query, and stops the second × 100 conversion. The global search box only edits the keyword — the amount filter is set elsewhere and stored in cents — so skipping conversion here is safe.
What alternative solutions did you explore? (Optional)
None needed — the root cause is a single missing flag, and the correct contract already exists in the codebase.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/99071) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Amount filters are stored in two different units. The q query param and the advanced
filters form both hold backend amounts (cents) — buildAmountFilterQuery writes the form
value straight into the query — while the text shown in the search box holds frontend
amounts (dollars), produced by buildUserReadableQueryString.
When a keyword is typed into the search box, submitSearch in SearchRouter.tsx calls getQueryWithUpdatedValues with shouldSkipAmountConversion set to false, because the
pressed item is the FIND_ITEM row. That runs convertToBackendAmount over the amount
filter. <<< ONE SENTENCE: why the value reaching that call is already in cents >>>
The result is a second multiplication by 100, so $500 becomes $50,000.
What changes do you think we should make in order to solve the problem?
<<< the minimal fix at the point where the unit is decided, not at the display layer >>>
The underlying issue is that the unit of an amount filter value is implicit — the same
string means dollars in one place and cents in another, and correctness depends on every
call site passing the right shouldSkipAmountConversion flag. A durable fix is to make buildUserReadableQueryString not re-apply the frontend conversion to rawFilterList
values, which are already frontend amounts, so that the search box text has one
well-defined unit no matter which branch produced it.
What alternative solutions did you explore? (Optional)
Clearing rawQuery on this submit path, the way useUpdateFilterQuery, SortByPopup, SortOrderPopup and Search/index.tsx already do, also makes the symptom go away. I
don't think it's the right fix: it adds a fifth workaround for stale rawQuery rather
than removing the ambiguity, and it would lose the user's typed-in query formatting.
📣 @fawad1386! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Implemented the approved proposal — in SearchPageInput.submitSearch the rebuilt query is derived from queryJSON whose amount filters are already in backend cents, so it now passes shouldSkipAmountConversion = true to getQueryWithUpdatedValues, preventing the second × 100 on every keyword add/clear.
Checks run locally (all passing):
lint-changed
react-compiler-compliance-check
typecheck (tsgo)
SearchQueryUtilsTest (298 tests passed)
⚠️ I could not exercise the fix in a running web build: the pre-started test session rendered a blank page (0 accessible nodes) despite a healthy dev server and a successful compile of the changed file. This looks like a session/infra issue rather than anything from the change. The Tests/QA steps and screenshots are left for the human co-author to complete.
Please mark the PR as "Ready for review" when it is ready.
Issue is ready for payment but no BZ is assigned. @mallenexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Open App
Navigate to Spend > Expenses.
Add an Amount filter using Less than, Greater than, or Equal to, and enter an amount, e.g. $500.
Add a keyword to the global Search box, or reset/clear the search box.
Review the Amount filter value.
Verify the Amount filter value stays $500 (it is NOT multiplied by 100 to $50,000).
Activity
MelvinBot commentedon Aug 20, 2026
Proposal
What is the root cause of that problem?
The amount filter value is converted from dollars to cents a second time every time the keyword in the global Search box changes.
Amounts in a search query are stored in backend cents (e.g.
$500→amount>50000). When you add or clear a keyword,SearchPageInput.submitSearchrebuilds the query and callsgetQueryWithUpdatedValues(queryWithContext)without theshouldSkipAmountConversionflag. That flag defaults tofalse, sogetUpdatedFilterValuerunsconvertToBackendAmount(× 100) on a value that is already in cents:50000 → 5,000,000, which displays as$50,000. Each keyword add/clear multiplies it by 100 again.The sibling
SearchRoutercomponent already handles this correctly by threadingshouldSkipAmountConversion = true—SearchPageInputis the one caller that forgot to.Evidence / data flow
$500→ stored in the URL query asamount>50000(cents — the correct, first conversion).onSubmitEditing/onClearInputboth callsubmitSearch(...)(SearchPageInput.tsx:68-87).getKeywordQueryWithCurrentSearchContextrebuilds the query string, preservingamount>50000(cents, no conversion) and appending the keyword.getQueryWithUpdatedValuesis called withshouldSkipAmountConversiondefaulting tofalse.getUpdatedFilterValue→convertToBackendAmount(50000)=5,000,000→ query becomesamount>5000000→ filter now shows $50,000.Correct pattern for comparison:
SearchRouter.submitSearchpassesshouldSkipAmountConversionthrough because its query already holds backend amounts.The static twin
StaticSearchPageInput.tsxdoes not callgetQueryWithUpdatedValues, so it is not affected — no additional fix needed there.What changes do you think we should make in order to solve the problem?
In
SearchPageInput.submitSearch, passtrueas the second argument togetQueryWithUpdatedValues, sincequeryWithContextis derived from the currentqueryJSONwhose amounts are already in backend cents:This matches how
SearchRouterandbuildFilterQueryWithSortDefaultsre-serialize an already-persisted query, and stops the second× 100conversion. The global search box only edits the keyword — the amount filter is set elsewhere and stored in cents — so skipping conversion here is safe.What alternative solutions did you explore? (Optional)
None needed — the root cause is a single missing flag, and the correct contract already exists in the codebase.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/99071)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Aug 20, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach (
External)melvin-bot commentedon Aug 20, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022090437034246054101
fawad1386 commentedon Aug 20, 2026
Proposal
What is the root cause of that problem?
Amount filters are stored in two different units. The
qquery param and the advancedfilters form both hold backend amounts (cents) —
buildAmountFilterQuerywrites the formvalue straight into the query — while the text shown in the search box holds frontend
amounts (dollars), produced by
buildUserReadableQueryString.When a keyword is typed into the search box,
submitSearchinSearchRouter.tsxcallsgetQueryWithUpdatedValueswithshouldSkipAmountConversionset tofalse, because thepressed item is the
FIND_ITEMrow. That runsconvertToBackendAmountover the amountfilter. <<< ONE SENTENCE: why the value reaching that call is already in cents >>>
The result is a second multiplication by 100, so $500 becomes $50,000.
What changes do you think we should make in order to solve the problem?
<<< the minimal fix at the point where the unit is decided, not at the display layer >>>
The underlying issue is that the unit of an amount filter value is implicit — the same
string means dollars in one place and cents in another, and correctness depends on every
call site passing the right
shouldSkipAmountConversionflag. A durable fix is to makebuildUserReadableQueryStringnot re-apply the frontend conversion torawFilterListvalues, which are already frontend amounts, so that the search box text has one
well-defined unit no matter which branch produced it.
What alternative solutions did you explore? (Optional)
Clearing
rawQueryon this submit path, the wayuseUpdateFilterQuery,SortByPopup,SortOrderPopupandSearch/index.tsxalready do, also makes the symptom go away. Idon't think it's the right fix: it adds a fifth workaround for stale
rawQueryratherthan removing the ambiguity, and it would lose the user's typed-in query formatting.
melvin-bot commentedon Aug 20, 2026
📣 @fawad1386! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:
Format:
fawad1386 commentedon Aug 20, 2026
Contributor details
Your Expensify account email: mohammad.fawad.564@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0117352b6a499bb019
melvin-bot commentedon Aug 20, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
ZhenjaHorbach commentedon Aug 24, 2026
@MelvinBot
Implement your proposal
MelvinBot commentedon Aug 24, 2026
🤖 Draft PR created: #99313
Implemented the approved proposal — in
SearchPageInput.submitSearchthe rebuilt query is derived fromqueryJSONwhose amount filters are already in backend cents, so it now passesshouldSkipAmountConversion = truetogetQueryWithUpdatedValues, preventing the second× 100on every keyword add/clear.Checks run locally (all passing):
lint-changedreact-compiler-compliance-checktypecheck(tsgo)SearchQueryUtilsTest(298 tests passed)Tests/QAsteps and screenshots are left for the human co-author to complete.Please mark the PR as "Ready for review" when it is ready.
view run
melvin-bot commentedon Aug 27, 2026
@ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
15 remaining items
melvin-bot commentedon Sep 4, 2026
@ZhenjaHorbach Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Sep 4, 2026
@ZhenjaHorbach Whoops! This issue is 2 days overdue. Let's get this updated quick!
melvin-bot commentedon Sep 6, 2026
Auto-assign attempt failed, all eligible assignees are OOO.
melvin-bot commentedon Sep 6, 2026
Issue is ready for payment but no BZ is assigned. @mallenexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!
melvin-bot commentedon Sep 6, 2026
Payment Summary
Resolving PRs:
Fix Amount filter being multiplied by 100x when using the global search box #99313
Reviewer: @ZhenjaHorbach owed $250 via NewDot
BugZero Checklist (@mallenexpensify)
ZhenjaHorbach commentedon Sep 7, 2026
Contributor+ Checklist:
https://github.com/Expensify/App/pull/93543/changes#r3947862251
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Test:
Do we agree 👍 or 👎
mallenexpensify commentedon Sep 8, 2026
Payment Summary
Contributor+: @ZhenjaHorbach due $250 via NewDot
garrettmknight commentedon Oct 7, 2026
$250 approved for @ZhenjaHorbach