Skip to content

[Due for payment 2026-04-01] [Due for payment 2026-03-30] Tax -Tax menu item is empty when Taxes are enabled after creating expense #85729

Closed

Description

@mitarachim

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.40-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #78472
Email or phone of affected tester (no customers): sdjoidjossdoisnjs@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace.
  3. Go to workspace chat.
  4. Create an expense.
  5. Go to workspace settings > More features.
  6. Enable Taxes.
  7. Open the expense from Step 4.
  8. Click Tax field.

Expected Result:

Tax menu item will show Default tax (0%).

Actual Result:

Tax menu item is empty, when Default tax (0%) is selected.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7106337_1773846145127.14.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Mar 19, 2026
  2. melvin-bot commented on Mar 19, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #78472

  3. melvin-bot commented on Mar 19, 2026

    @melvin-bot

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

  4. github-actions commented on Mar 19, 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. OSBotify commented on Mar 19, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #78472 - "Improve deleted tax behavior" by @huult (High confidence)
    Related Issues: #73033 (original issue that PR 78472 was fixing)

    Recommendation: REVERT

    PR #78472 introduced a regression that causes the tax field to be empty when taxes are enabled after an expense is created. Reverting this PR will restore the previous behavior where the default tax is shown correctly.

    Labels: Removed DeployBlocker label (this is a frontend bug caused by an App PR, so only DeployBlockerCash should block the App deploy).

    📋 Detailed Analysis

    Evidence

    The bug occurs specifically in the scenario outlined in the issue:

    1. Create an expense BEFORE enabling taxes on a workspace
    2. Enable taxes on the workspace
    3. View the expense - the tax field shows empty instead of "Default tax (0%)"

    PR #78472 was intended to improve the handling of deleted/modified tax rates, but it introduced a regression in how expenses without a taxCode are displayed.

    Verification

    I verified that PR #78472 modified the exact file and logic responsible for displaying the tax field:

    File: src/components/ReportActionItem/MoneyRequestView.tsx

    Before PR #78472 (line ~308):

    const taxRateTitle = updatedTransaction ? getTaxName(policy, updatedTransaction, isExpenseUnreported) : getTaxName(policy, transaction, isExpenseUnreported);

    After PR #78472 (lines 310-313):

    const baseTransaction = updatedTransaction ?? transaction;
    const {taxCode, taxValue} = baseTransaction ?? {};
    
    const taxRateTitle = taxCode ? getTaxName(policy, baseTransaction, isExpenseUnreported) : '';

    Root Cause

    The new code checks if (taxCode) before calling getTaxName(). When an expense is created before taxes are enabled:

    • The taxCode field is empty/undefined (because taxes were not enabled at creation time)
    • The new conditional returns an empty string '' without calling getTaxName()
    • The getTaxName() function has internal logic to fall back to defaultTaxCode when transaction?.taxCode is empty (see src/libs/TransactionUtils/index.ts line 2168)
    • By skipping the getTaxName() call, the code never retrieves the default tax that should be shown

    The old code always called getTaxName(), which correctly handled the case where taxCode is empty by falling back to the default tax code from the policy.

    Impact: This affects any expense created before taxes are enabled on a workspace. When viewing such expenses after enabling taxes, users see an empty tax field instead of the default tax rate.

  6. MelvinBot commented on Mar 19, 2026

    @MelvinBot
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    When an expense is created before the Taxes feature is enabled on a workspace, opening that expense and viewing the Tax field shows it as empty instead of displaying the default tax rate (e.g., "Default tax (0%)").

    What is the root cause of that problem?

    PR #78472 ("Improve deleted tax behavior") introduced a guard in MoneyRequestView.tsx that skips calling getTaxName() when the transaction has no taxCode:

    // Before (always called getTaxName, which fell back to the policy's default tax):
    const taxRateTitle = updatedTransaction
        ? getTaxName(policy, updatedTransaction, isExpenseUnreported)
        : getTaxName(policy, transaction, isExpenseUnreported);
    
    // After (returns empty string when taxCode is falsy):
    const taxRateTitle = taxCode ? getTaxName(policy, baseTransaction, isExpenseUnreported) : '';
    

    For expenses created before taxes were enabled, taxCode is undefined. Previously, getTaxName() handled this gracefully — it uses transaction?.taxCode || defaultTaxCode internally (TransactionUtils/index.ts:2168), which falls back to the policy's default tax code and returns the correct display name.

    After the change, taxRateTitle is set to '' (empty string). The display fallback chain transaction?.taxName ?? taxRateTitle ?? fallbackTaxRateTitle uses the nullish coalescing operator (??), which treats '' as a valid value and stops there — so the field renders blank.

    What changes do you think we should make in order to solve the problem?

    In src/components/ReportActionItem/MoneyRequestView.tsx, remove the taxCode guard so getTaxName() is always called (restoring the original behavior for this line), while keeping the rest of the deleted-tax improvements from the PR intact:

    Change the taxRateTitle computation from:

    const taxRateTitle = taxCode ? getTaxName(policy, baseTransaction, isExpenseUnreported) : '';
    

    to:

    const taxRateTitle = getTaxName(policy, baseTransaction, isExpenseUnreported);
    

    This restores the fallback to the policy's default tax name for transactions without a taxCode, while the hasTaxValueChanged logic (which also depends on taxCode) continues to handle the deleted-tax scenario correctly.

    What alternative solutions did you explore? (Optional)

    An alternative would be to change the empty string '' to undefined so the nullish coalescing chain falls through to fallbackTaxRateTitle. However, fallbackTaxRateTitle is transaction?.taxValue, which is also undefined for pre-tax transactions — so the field would still end up blank. Calling getTaxName() unconditionally is the correct fix since it already has built-in fallback logic for missing taxCode.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. 9 remaining items

  8. changed the title [-]Tax -Tax menu item is empty when Taxes are enabled after creating expense[/-] [+][Due for payment 2026-03-30] Tax -Tax menu item is empty when Taxes are enabled after creating expense[/+] on Mar 23, 2026
  9. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  10. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.41-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-03-30. 🎊

    For reference, here are some details about the assignees on this issue:

    • @huult requires payment through NewDot Manual Requests
    • @thesahindia requires payment through NewDot Manual Requests
  11. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    @huult / @thesahindia The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  12. melvin-bot commented on Mar 23, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  13. changed the title [-][Due for payment 2026-03-30] Tax -Tax menu item is empty when Taxes are enabled after creating expense[/-] [+][Due for payment 2026-04-01] [Due for payment 2026-03-30] Tax -Tax menu item is empty when Taxes are enabled after creating expense[/+] on Mar 25, 2026
  14. melvin-bot commented on Mar 25, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.43-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-04-01. 🎊

    For reference, here are some details about the assignees on this issue:

    • @huult requires payment through NewDot Manual Requests
    • @thesahindia requires payment through NewDot Manual Requests
  15. melvin-bot commented on Mar 25, 2026

    @melvin-bot

    @huult / @thesahindia @mallenexpensify The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  16. mallenexpensify commented on Mar 30, 2026

    @mallenexpensify
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions