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
Rules - Tax field is empty after changing default tax rate to category tax rate #100532
Version Number: 9.4.73-0 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+ssndjois2jd1@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.5 / Chrome App Component: Workspace Settings
Action Performed:
Precondition:
Log in with Expensifail account.
Enable Taxes and Rules.
Go to staging.new.expensify.com
Go to workspace settings > Rules.
Click Add rule > Apply expense defaults.
Click Category.
Select a category and 5% tax rate.
Click Save rule.
Go to workspace settings > Taxes.
Open Settings.
Change Workspace currency default and Foreign currency default to 5% rate.
Go to workspace settings > Rules.
Open the rule created in Step 6.
Click Tax field.
Expected Result:
Tax field will show the selected tax rate after changing default tax rate to category tax rate.
Actual Result:
Tax field is empty after changing default tax rate to category tax 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 Causing PR: #99420 - "Rules: Apply expense defaults — category tax rules" by @Krishna2323 (High confidence) Related Issues: #99410 (the issue PR #99420 implemented)
Recommendation: ROLL FORWARD
The bug is a two-line scoping mistake — a "tax equals the workspace default rate" check that belongs only on the write path is also applied when reading back a saved rule — while PR #99420 is a large feature PR (43 files, new routes, screens, and 11 translation files) whose revert would be far riskier than the targeted fix. The flow is also behind the rulesRevamp beta, which bounds the blast radius.
Assigned: @Krishna2323 (PR author), @situchan and @JS00001 (approving reviewers) — already auto-assigned by Melvin, no change needed. Labels: No changes. DeployBlockerCash is correctly applied and stays (App-side fix). DeployBlocker was not present, so nothing to remove.
PR Add category tax defaults to Expense defaults #99420 built the whole category tax default rule flow, including the exact pages in the repro: the Expense defaults rule editor (MerchantRulePageBase), the EditCategoryTaxRulePage route opened in step 11, and the tax picker (AddTaxPage) opened in step 12.
Both offending lines are additions in that PR's diff (they appear as + lines in gh pr diff 99420), so nothing pre-existing is involved.
The PR's own test plan states the intended behavior: "Open Tax: verify no None option and workspace default rate isn't listed." That rule was written assuming the workspace default rate could never also be a rule's saved rate — step 9 of this repro makes it exactly that.
Clearing a category's tax default is implemented as writing the workspace default rate back to the category (deletePolicyCategoryTaxes issues SET_POLICY_CATEGORY_TAX with defaultExternalID). From that, the editor concludes that a draft tax equal to the workspace default means "no rule":
That equality is only sound for a value the admin just picked. It is applied unconditionally, including to the rate seeded from the already-saved rule at L182-L192. Step 9 changes the workspace default to the 5% rate the rule already stores, so form.tax === defaultExternalID becomes true for a rule that genuinely exists, and it is silently treated as unset:
categoryTaxID → undefined, so taxRateID → undefined → taxDisplayName → undefined → the Tax row renders empty (the reported symptom).
In the picker, shouldHideTax now filters the 5% rate out of taxItems, so selectedTaxItem can never resolve — step 12 opens a list that neither offers the rule's own rate nor shows it as selected.
Meanwhile the Expense defaults table still lists the rule, because getCategoryTaxRules only checks that an externalID and a category are present and applies no default-equality test. So the table says "update tax to 5%" while the editor says the tax is unset — the two disagree about whether the rule exists.
Only treat "tax equals workspace default" as "no rule" for a rate the admin picked in this session, not for one seeded from the saved rule (e.g. skip the nullification when the value still equals existingCategoryTaxID).
In AddTaxPage, never hide a rate that is the rule's current form.tax, so the picker can always show the current selection.
Activity
applause-bot commentedon Sep 7, 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/5e47b0fa1fbf075f6f5b2da9e3576b814b99e975df9c3940a806854810868620
melvin-bot commentedon Sep 7, 2026
@JS00001 recently merged #99420, but they are OOO right now, so I'll auto-assign someone else.
github-actions commentedon Sep 7, 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 7, 2026
Triggered auto assignment to @lakchote (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon Sep 7, 2026
@JS00001 @situchan you have been assigned to this deploy blocker because you reviewed the offending PR: #99420
melvin-bot commentedon Sep 7, 2026
@Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #99420
melvin-bot commentedon Sep 7, 2026
💬 A slack conversation has been started in #expensify-open-source
MelvinBot commentedon Sep 7, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #99420 - "Rules: Apply expense defaults — category tax rules" by @Krishna2323 (High confidence)
Related Issues: #99410 (the issue PR #99420 implemented)
Recommendation: ROLL FORWARD
The bug is a two-line scoping mistake — a "tax equals the workspace default rate" check that belongs only on the write path is also applied when reading back a saved rule — while PR #99420 is a large feature PR (43 files, new routes, screens, and 11 translation files) whose revert would be far riskier than the targeted fix. The flow is also behind the
rulesRevampbeta, which bounds the blast radius.Assigned: @Krishna2323 (PR author), @situchan and @JS00001 (approving reviewers) — already auto-assigned by Melvin, no change needed.
Labels: No changes.
DeployBlockerCashis correctly applied and stays (App-side fix).DeployBlockerwas not present, so nothing to remove.📋 Detailed Analysis
Evidence
2026-09-04, three days before this report onv9.4.73-0. The report is staging-only /N/Aon production, which matches a brand-new feature.MerchantRulePageBase), theEditCategoryTaxRulePageroute opened in step 11, and the tax picker (AddTaxPage) opened in step 12.+lines ingh pr diff 99420), so nothing pre-existing is involved.Tax: verify noNoneoption and workspace default rate isn't listed." That rule was written assuming the workspace default rate could never also be a rule's saved rate — step 9 of this repro makes it exactly that.Verification
Affected files, both changed by PR #99420:
src/pages/workspace/rules/MerchantRules/MerchantRulePageBase.tsx#L285-L287— the empty Tax fieldsrc/pages/workspace/rules/MerchantRules/AddTaxPage.tsx#L32-L45— the rate missing from the picker in step 12Root Cause
Clearing a category's tax default is implemented as writing the workspace default rate back to the category (
deletePolicyCategoryTaxesissuesSET_POLICY_CATEGORY_TAXwithdefaultExternalID). From that, the editor concludes that a draft tax equal to the workspace default means "no rule":MerchantRulePageBase.tsx#L287That equality is only sound for a value the admin just picked. It is applied unconditionally, including to the rate seeded from the already-saved rule at L182-L192. Step 9 changes the workspace default to the 5% rate the rule already stores, so
form.tax === defaultExternalIDbecomes true for a rule that genuinely exists, and it is silently treated as unset:categoryTaxID→undefined, sotaxRateID→undefined→taxDisplayName→undefined→ the Tax row renders empty (the reported symptom).shouldHideTaxnow filters the 5% rate out oftaxItems, soselectedTaxItemcan never resolve — step 12 opens a list that neither offers the rule's own rate nor shows it as selected.getCategoryRuleErrorMessagenow reports "tax required" andsaveRulebails on!categoryTaxID, so the rule cannot be saved or moved to another category until a different rate is chosen.getCategoryTaxRulesonly checks that anexternalIDand a category are present and applies no default-equality test. So the table says "update tax to 5%" while the editor says the tax is unset — the two disagree about whether the rule exists.Suggested targeted fix (for @Krishna2323 / @situchan to confirm):
existingCategoryTaxID).AddTaxPage, never hide a rate that is the rule's currentform.tax, so the picker can always show the current selection.situchan commentedon Sep 7, 2026
The feature is behind beta. Not blocker
lakchote commentedon Sep 7, 2026
Behind beta, demoting
fix: agree on how a category tax rule's rate is displayed