Skip to content

[Due for payment 2026-05-07] Expense - Tax defaults to 0% after creating unreported expense with other tax rate #88656

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.62-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: #87911
Email or phone of affected tester (no customers): sjdosjdnsdiojsd@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:

Precondition:

  • Enable Taxes in workspace settings.
  1. Go to staging.new.expensify.com
  2. Go to self DM.
  3. Create an expense with 5% tax rate.
  4. Open the expense.

Expected Result:

Tax field will show 5% tax rate.

Actual Result:

Tax field shows 0% tax rate.
The selected tax during creation s not saved.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7137007_1776981438969.15.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @hoangzinh

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Apr 23, 2026
  2. melvin-bot commented on Apr 23, 2026

    @melvin-bot

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

  3. melvin-bot commented on Apr 23, 2026

    @melvin-bot

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

  4. github-actions commented on Apr 23, 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. chuckdries commented on Apr 23, 2026

    @chuckdries
    Contributor

    Hm, I do wonder whether workspace tax rates are really expected to work correctly in selfDM, since those reports are not associated with the workspace

  6. chuckdries commented on Apr 23, 2026

    @chuckdries
    Contributor

    @mitarachim do you have any more context about the test case? Is there any way to tell when the regression was originally created, what issue it was associated with?

  7. OSBotify commented on Apr 23, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #87993 - "Fix: Time expenses are created with tax" by @dominictb (Medium confidence)
    Related Issues: The melvin-bot flagged #87911 based on which PR the tester was regressing when they found the bug, but that PR's changes are isolated to distance-rate tax code selection and cannot affect regular expense creation.

    Recommendation: NEEDS INVESTIGATION

    PR #87993 is the most likely cause based on code analysis, but the exact reproduction path needs confirmation from the PR author or QA. The PR author (@dominictb) and reviewers should verify whether the isTaxTrackingEnabled gate in useExpenseSubmission.ts drops the user-selected tax code in certain policy configurations.

    Assigned: @dominictb (PR author), @hoangzinh and @youssef-lr (approving reviewers) from highest-confidence causing PR
    Labels: Keeping both DeployBlockerCash and DeployBlocker labels — this is a frontend bug in Expensify/App but exact reproduction path needs confirmation before removing DeployBlocker.

    Details

    Evidence

    Why PR #87993 is the primary suspect:

    PR #87993 ("Fix: Time expenses are created with tax", merged April 21, 2026) modified src/pages/iou/request/step/confirmation/useExpenseSubmission.ts to add an isTaxTrackingEnabled gate around the transactionTaxCode computation:

    Before PR #87993:

    const transactionTaxCode =
      (transaction?.taxCode ? transaction?.taxCode : defaultTaxCode) ?? "";

    After PR #87993:

    const transactionTaxCode = isTaxTrackingEnabled(
      isPolicyExpenseChat || isUnreported,
      policy,
      isDistanceRequest,
      isPerDiemRequest,
      isTimeRequest,
    )
      ? ((transaction?.taxCode ? transaction?.taxCode : defaultTaxCode) ?? "")
      : "";

    If isTaxTrackingEnabled returns false for any reason (e.g., policy is undefined or policy.tax.trackingEnabled is falsy), the user's explicitly selected transaction.taxCode (5% tax rate) is discarded and '' is submitted instead, causing the expense to show 0% tax.

    Why PR #87911 is NOT the cause:

    PR #87911 ("fix: Wrong tax rate is used when selecting a distance rate", merged April 22, 2026) modified getDefaultTaxCode in TransactionUtils/index.ts and IOURequestStepDistanceRate.tsx. All changes in PR #87911 are inside the if (isDistanceRequest(transaction)) guard. The bug reports a regular manual expense (not distance) created in self DM - the distance-specific code path is never triggered for this scenario.

    Why the bug is staging-only:

    Both PR #87911 and PR #87993 are in the 9.3.62-0 staging release and not in production, consistent with the bug being staging-only.

    Verification

    Root Cause

    isTaxTrackingEnabled(isPolicyExpenseChat || isUnreported, policy, ...) can return false for an unreported self-DM expense if:

    1. policy (the policyForMovingExpenses) is undefined — this happens when usePolicyForMovingExpenses resolves to undefined (e.g., user has multiple workspaces and none is selected as active, or no valid workspace exists)
    2. policy.tax.trackingEnabled is false or undefined

    In either case, the user's selected 5% tax code stored in the draft transaction (transaction.taxCode) is silently discarded, and the expense is submitted with taxCode: '' and taxAmount: 0, resulting in 0% tax being displayed when the expense is opened.

    The original code before PR #87993 did not have this gate and would always use transaction.taxCode if it was set, preserving the user's tax selection.

  8. 5 remaining items

  9. chuckdries commented on Apr 24, 2026

    @chuckdries
    Contributor

    Normally we prefer to revert, but the fix-forward patch is very simple and was prepared promptly, so I've merged it. Going to request a CP to staging now

  10. arosiclair commented on Apr 27, 2026

    @arosiclair
    Contributor

    Requested a retest here

  11. IuliiaHerets commented on Apr 27, 2026

    @IuliiaHerets

    @arosiclair Issue is not reproduced anymore on Windows 10/Chrome and iPhone 13/iOS 26.3, v9.3.62-5

    ScreenRecording_04-27-2026.18-38-39_1.MP4
    bandicam.2026-04-27.18-30-05-762.mp4
  12. changed the title [-]Expense - Tax defaults to 0% after creating unreported expense with other tax rate[/-] [+][Due for payment 2026-05-07] Expense - Tax defaults to 0% after creating unreported expense with other tax rate[/+] on Apr 30, 2026
  13. melvin-bot commented on Apr 30, 2026

    @melvin-bot

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

  14. melvin-bot commented on Apr 30, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 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-05-07. 🎊

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

    • @hoangzinh requires payment through NewDot Manual Requests
    • @dominictb does not require payment (Contractor)
  15. melvin-bot commented on Apr 30, 2026

    @melvin-bot

    @hoangzinh 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]

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions