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-10-14] Expense-Deselecting category shows 0% tax rate briefly and changes to previous rate #100591
Version Number: V9.4.73-3 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#99420 Email or phone of affected tester (no customers):Applausetester+wiw@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Redmi note 10s android 13 App Component: Money Requests
Action Performed:
Launch Expensifail account
2. Create workspace - enable taxes and add a tax rate
3. Enable rules - upgrade - add rule - apply expense default - category rule
4. Select all categories - set tax rate added in
step 2
5. Open Workspace chat
6. Create a manual expense with any category
7. Open the expense and deselect the category
Expected Result:
Deselecting category must not show 0% tax rate briefly.
Actual Result:
Deselecting category shows 0% tax rate briefly and changes to previous rate
👋 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.
Classification: Frontend bug (fix belongs in Expensify/App), but not a regression from this release Causing PR: None on this checklist. The optimistic code that produces the 0% flash is byte-identical on production and staging. #99420 - "Add category tax defaults to Expense defaults" by @Krishna2323 is not the cause (High confidence it is not) — it only adds a bulk UI for creating the same category tax rules that already exist in production. Related Issues: #99410 (the issue #99420 implements)
Recommendation: DEMOTE
The flash-then-revert comes from pre-existing production logic (getCategoryTaxDetails + getUpdatedTransaction), so reverting #99420 would not fix it — the rules already stored on the policy would still trigger it, and the same repro is reachable on production via Workspace → Categories → category → Default tax rate. It is a transient display flicker that self-corrects to the server value, so it should be demoted and fixed by roll-forward with the one-line guard below.
Assigned: No new assignees. @Krishna2323, @JS00001, @situchan were auto-assigned by Melvin for #99420 — that PR isn't the cause, but they own this area and the targeted fix below is small if they want to take it. Labels: No changes made. DeployBlockerCash intentionally left in place — production reproducibility is listed as N/A by the reporter, and per triage rules the label shouldn't be removed on an unverified production repro. An internal engineer should confirm the production repro (steps below) and then demote.
📋 Detailed Analysis
Evidence
Diffed production...staging for every file in the category → tax code path:
File
production vs staging
src/libs/TransactionUtils/index.ts — getCategoryTaxDetails + the category branch of getUpdatedTransaction
identical (the only release diff in this file adds isScanFailedTransactionMovedOnPayment / shouldSplitScanFailedTransactions)
This cannot produce the reported symptom: on deselect the category name is '', and both the old and the new matcher fail to match any rule for '', so both fall through to the identical return defaultTaxRate; branch. #99420 also writes its rules with the same SET_POLICY_CATEGORY_TAX command production already uses (setPolicyCategoryTaxes, with setPolicyCategoryTax now a one-item wrapper), so the stored rule shape is unchanged too.
Production repro (why this is not new): production already exposes a per-category default tax rate at Workspace → Categories → category → Default tax rate (CategorySettingsPage, gated only on policy.tax.trackingEnabled, saving through DynamicCategoryDefaultTaxRatePage → setPolicyCategoryTax). Set a tax rate on one category there, create an expense in that category, then deselect the category: the same flash should occur. #99420 only makes the setup faster (all categories at once) — it does not change the runtime behaviour.
Verification
Affected files (all at staging e824ab763b1cddf2f28fe0fc9f7e8f24dd5b3466):
getCategoryDefaultTaxRate(taxRules, '', defaultTaxCode) finds no rule for '' and returns the workspace default (getDefaultTaxCode → policy.taxRates.defaultExternalID, i.e. id_TAX_EXEMPT at 0% — see CONST.DEFAULT_TAX).
getTaxValue returns the string '0%', which is truthy, and categoryTaxAmount becomes 0, which is !== undefined — so the guard passes and the optimistic transaction is written with the 0% exempt rate. That is the brief 0% the tester sees.
The server response is authoritative and, judging by the observed outcome, the backend does not reset the tax rate when the category is cleared — it returns the previous (category rule) rate, so the row snaps back.
The frontend is optimistically applying a "recompute the default" that the backend never performs for a cleared category.
Targeted fix (roll forward). Guard on an empty category inside getCategoryTaxDetails so both call sites (getUpdatedTransaction and setMoneyRequestCategory) are covered:
functiongetCategoryTaxDetails(category: string,transaction: OnyxEntry<Transaction>,policy: OnyxEntry<Policy>,getCurrencyDecimals: CurrencyListActionsContextType['getCurrencyDecimals']){consttaxRules=policy?.rules?.expenseRules?.filter((rule)=>rule.tax);// Clearing the category has no category default to apply. The backend leaves the tax rate alone, so recomputing// here would optimistically write the workspace default (Tax exempt, 0%) and then bounce back to the server value.if(!category||!taxRules||taxRules.length===0||isDistanceRequest(transaction)){return{categoryTaxCode: undefined,categoryTaxAmount: undefined,categoryTaxValue: undefined};}
...
If the product intent is instead that clearing the category should reset the tax to the workspace default, then the frontend is right and the backend needs a matching change — otherwise the value will always bounce back and the flicker cannot be fixed in App alone.
@situchan this issue and/or PR mention a deploy blocker or a regression. Before the payment date, post one of the three options in step 20 of the C+ doc: it was a regression, it was not, or you did not review the offending PR. If you don't post, the default is to reduce payment.
Activity
applause-bot commentedon Sep 8, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/a01143f07179556dc012345135bebb996f1157e35ce2ca336ba8ebf03802e150
melvin-bot commentedon Sep 8, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #99420
github-actions commentedon Sep 8, 2026
👋 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:
melvin-bot commentedon Sep 8, 2026
@JS00001 @situchan you have been assigned to this deploy blocker because you reviewed the offending PR: #99420
melvin-bot commentedon Sep 8, 2026
@Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #99420
melvin-bot commentedon Sep 8, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Sep 8, 2026
🔍 Investigation Summary
Classification: Frontend bug (fix belongs in
Expensify/App), but not a regression from this releaseCausing PR: None on this checklist. The optimistic code that produces the 0% flash is byte-identical on
productionandstaging. #99420 - "Add category tax defaults to Expense defaults" by @Krishna2323 is not the cause (High confidence it is not) — it only adds a bulk UI for creating the same category tax rules that already exist in production.Related Issues: #99410 (the issue #99420 implements)
Recommendation: DEMOTE
The flash-then-revert comes from pre-existing production logic (
getCategoryTaxDetails+getUpdatedTransaction), so reverting #99420 would not fix it — the rules already stored on the policy would still trigger it, and the same repro is reachable on production via Workspace → Categories → category → Default tax rate. It is a transient display flicker that self-corrects to the server value, so it should be demoted and fixed by roll-forward with the one-line guard below.Assigned: No new assignees. @Krishna2323, @JS00001, @situchan were auto-assigned by Melvin for #99420 — that PR isn't the cause, but they own this area and the targeted fix below is small if they want to take it.
Labels: No changes made.
DeployBlockerCashintentionally left in place — production reproducibility is listed asN/Aby the reporter, and per triage rules the label shouldn't be removed on an unverified production repro. An internal engineer should confirm the production repro (steps below) and then demote.📋 Detailed Analysis
Evidence
Diffed
production...stagingfor every file in the category → tax code path:src/libs/TransactionUtils/index.ts—getCategoryTaxDetails+ thecategorybranch ofgetUpdatedTransactionisScanFailedTransactionMovedOnPayment/shouldSplitScanFailedTransactions)src/libs/actions/IOU/MoneyRequest.ts—setMoneyRequestCategorysrc/pages/iou/request/step/DynamicIOURequestStepCategory.tsx(deselect handler)d06fc0765e692aebd8d1d0d475d0556996fa18e4on both refs)src/libs/CategoryUtils.ts—getCategoryDefaultTaxRateThe single staging-only change is
f10b9d0bd101928aa0bdd0bca755ed36f8a1a2cdfrom #99420, which swapped a loose matcher for the strict one:This cannot produce the reported symptom: on deselect the category name is
'', and both the old and the new matcher fail to match any rule for'', so both fall through to the identicalreturn defaultTaxRate;branch. #99420 also writes its rules with the sameSET_POLICY_CATEGORY_TAXcommand production already uses (setPolicyCategoryTaxes, withsetPolicyCategoryTaxnow a one-item wrapper), so the stored rule shape is unchanged too.Production repro (why this is not new): production already exposes a per-category default tax rate at Workspace → Categories → category → Default tax rate (
CategorySettingsPage, gated only onpolicy.tax.trackingEnabled, saving throughDynamicCategoryDefaultTaxRatePage→setPolicyCategoryTax). Set a tax rate on one category there, create an expense in that category, then deselect the category: the same flash should occur. #99420 only makes the setup faster (all categories at once) — it does not change the runtime behaviour.Verification
Affected files (all at staging
e824ab763b1cddf2f28fe0fc9f7e8f24dd5b3466):DynamicIOURequestStepCategory.tsx#L174-L193:const updatedCategory = isSelectedCategory ? '' : categorySearchText;→updateMoneyRequestCategory({category: ''}).TransactionUtils/index.ts#L1019-L1027insidegetUpdatedTransaction, reached fromgetUpdateMoneyRequestParams.TransactionUtils/index.ts#L3269-L3285(getCategoryTaxDetails).CategoryUtils.ts#L99-L111(getCategoryDefaultTaxRate).MoneyRequest.ts#L681-L710(setMoneyRequestCategory).None of these, except item 4, differ from production, and item 4's change is inert for an empty category name.
Root Cause
getUpdatedTransactionrecomputes the category default tax on any category change, including clearing it:With
category === '':getCategoryDefaultTaxRate(taxRules, '', defaultTaxCode)finds no rule for''and returns the workspace default (getDefaultTaxCode→policy.taxRates.defaultExternalID, i.e.id_TAX_EXEMPTat0%— seeCONST.DEFAULT_TAX).getTaxValuereturns the string'0%', which is truthy, andcategoryTaxAmountbecomes0, which is!== undefined— so the guard passes and the optimistic transaction is written with the 0% exempt rate. That is the brief 0% the tester sees.The frontend is optimistically applying a "recompute the default" that the backend never performs for a cleared category.
Targeted fix (roll forward). Guard on an empty category inside
getCategoryTaxDetailsso both call sites (getUpdatedTransactionandsetMoneyRequestCategory) are covered:If the product intent is instead that clearing the category should reset the tax to the workspace default, then the frontend is right and the backend needs a matching change — otherwise the value will always bounce back and the flicker cannot be fixed in App alone.
38 remaining items
melvin-bot commentedon Oct 13, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Oct 13, 2026
Payment Summary
Resolving PRs:
Fix 0% tax rate flash when deselecting a category on an expense #101572
Reviewer: @Krishna2323 owed $175 via NewDot
Reviewer: @situchan owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
melvin-bot commentedon Oct 16, 2026
@mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
mallenexpensify commentedon Oct 16, 2026
@situchan this issue and/or PR mention a deploy blocker or a regression. Before the payment date, post one of the three options in step 20 of the C+ doc: it was a regression, it was not, or you did not review the offending PR. If you don't post, the default is to reduce payment.
situchan commentedon Oct 18, 2026
The bug happened in production before our PR. (2nd evidence: #100591 (comment))
I didn't specifically post because I already mentioned offending PR (I did not review)) in checklist.
mallenexpensify commentedon Oct 19, 2026
Payment Summary
Contributor: @Krishna2323 due $250 via NewDot
Contributor+: @situchan due $250 via NewDot
laurenreidexpensify commentedon Oct 21, 2026
Approved @Krishna2323 $250 New Expensify
trjExpensify commentedon Nov 3, 2026
approved $250 for @situchan