Skip to content

Rules - Tax field is empty after changing default tax rate to category tax rate #100532

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


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.
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Rules.
  3. Click Add rule > Apply expense defaults.
  4. Click Category.
  5. Select a category and 5% tax rate.
  6. Click Save rule.
  7. Go to workspace settings > Taxes.
  8. Open Settings.
  9. Change Workspace currency default and Foreign currency default to 5% rate.
  10. Go to workspace settings > Rules.
  11. Open the rule created in Step 6.
  12. 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.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7253527_1788792698302.10.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7253527

Activity

  1. applause-bot commented on Sep 7, 2026

    @applause-bot
    Author

    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

  2. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 7, 2026
  3. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    @JS00001 recently merged #99420, but they are OOO right now, so I'll auto-assign someone else.

  4. github-actions commented on Sep 7, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    Triggered auto assignment to @lakchote (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  6. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    @JS00001 @situchan you have been assigned to this deploy blocker because you reviewed the offending PR: #99420

  7. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    @Krishna2323 you have been assigned to this deploy blocker because you authored the offending PR: #99420

  8. melvin-bot commented on Sep 7, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  9. MelvinBot commented on Sep 7, 2026

    @MelvinBot
    Contributor

    🔍 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 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.

    📋 Detailed Analysis

    Evidence

    • PR Add category tax defaults to Expense defaults #99420 is item 40 on the current deploy checklist Deploy Checklist: New Expensify 2026-09-07 #100479 and merged 2026-09-04, three days before this report on v9.4.73-0. The report is staging-only / N/A on production, which matches a brand-new feature.
    • 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.

    Verification

    Affected files, both changed by PR #99420:

    Root Cause

    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":

    MerchantRulePageBase.tsx#L287

    const categoryTaxID = isCategoryRule && form?.tax === policy?.taxRates?.defaultExternalID ? undefined : form?.tax;

    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:

    1. categoryTaxID → undefined, so taxRateID → undefined → taxDisplayName → undefined → the Tax row renders empty (the reported symptom).
    2. 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.
    3. Worse than cosmetic: getCategoryRuleErrorMessage now reports "tax required" and saveRule bails on !categoryTaxID, so the rule cannot be saved or moved to another category until a different rate is chosen.
    4. 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.

    Suggested targeted fix (for @Krishna2323 / @situchan to confirm):

    • 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.
  10. situchan commented on Sep 7, 2026

    @situchan
    Contributor

    The feature is behind beta. Not blocker

  11. lakchote commented on Sep 7, 2026

    @lakchote
    Contributor

    Behind beta, demoting

  12. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Sep 7, 2026
  13. added
    ReviewingHas a PR in review
    and removed on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions