Skip to content

[Due for payment 2026-08-29] Expense - Unable to split expense with deleted tax #99133

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.58-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: #94434
Email or phone of affected tester (no customers): jndojdiojdojnidonj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Enable Taxes.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Delete the tax used in Step 3.
  5. Open the expense in Step 3.
  6. Click More > Split > Save.

Expected Result:

The expense can be split.

Actual Result:

Error shown when splitting expense with deleted tax.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7238811_1787274878339.2.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7238811

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 21, 2026
  2. applause-bot commented on Aug 21, 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/b734585b56060c0e678d0be59f4ff74b85f9e2b167c30e78aa0c1edf8f7ecea4

  3. melvin-bot commented on Aug 21, 2026

    @melvin-bot

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

  4. melvin-bot commented on Aug 21, 2026

    @melvin-bot

    @luacmartins @hoangzinh you have been assigned to this deploy blocker because you reviewed the offending PR: #94434

  5. melvin-bot commented on Aug 21, 2026

    @melvin-bot

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

  6. melvin-bot commented on Aug 21, 2026

    @melvin-bot

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

  7. github-actions commented on Aug 21, 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.
  8. MelvinBot commented on Aug 21, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #94434 - "feat: Add Tax, Billable, and Reimbursable selectors in the Split details page" by @truph01 (High confidence)
    Related Issues: #94038 (the feature request this PR implemented)

    Recommendation: ROLL FORWARD

    The offending code is an isolated edge case (a deleted tax rate) inside an otherwise-working, brand-new feature that only exists on staging. A targeted fix — clearing/omitting a tax code that no longer exists in the policy — is much smaller and safer than reverting a 9-file feature PR. Revert is a viable fallback if a fix can't land quickly.

    Assigned: @truph01 (PR author), @luacmartins, @hoangzinh (approving reviewers) — already assigned by melvin-bot
    Labels: No change. Only DeployBlockerCash is present; this is a Frontend bug so it correctly stays. DeployBlocker (Web) is not present and none is added.

    📋 Detailed Analysis

    Evidence

    Verification

    Files the PR touched that are on the failing path (all confirmed to contain the added tax logic in the current checkout, SHA 1465a42):

    • src/libs/actions/IOU/SplitTransactionUpdate.ts — builds the per-split save payload.
    • src/pages/iou/SplitExpenseEditPage.tsx — the split edit UI + its "tax disabled" guard.
    • src/libs/actions/IOU/SplitExpenseItems.ts — seeds each split's tax from the parent transaction.

    Root Cause

    When a tax rate is deleted from the policy but tax tracking stays enabled, the parent transaction keeps its now-orphaned taxCode. The new split flow inherits that stale code and sends it to the API on save, which rejects the unknown tax code → the error the tester saw.

    Two spots combine to cause it:

    1. The split save forwards the parent's tax code with no validity check. In SplitTransactionUpdate.ts L649 (and the reverse-split path at L703):

      taxCode: splitExpense.taxCode ?? originalTransactionTaxCode,

      originalTransactionTaxCode comes from resolveCurrentTaxCode, which falls back to the raw code when no current match exists — so a deleted code is passed straight through to the backend.

    2. The UI guard the PR added only covers tax tracking fully disabled, not this specific rate deleted. In SplitExpenseEditPage.tsx L206-L208:

      const isTaxEnabled = (isPolicyExpenseChat || isExpenseUnreported) && isTaxTrackingEnabled(true, effectivePolicy, ...);
      const shouldShowTaxDisabledAlert = !isTaxEnabled && !!splitExpenseDraftTransaction?.taxCode;

      With tax tracking still on, isTaxEnabled is true, so shouldShowTaxDisabledAlert is false — the user is never prompted to clear the orphaned tax, and the invalid code reaches the save.

    Recommended Fix

    Treat "tax code no longer exists in the policy's tax rates" the same way the PR already treats "tax tracking disabled": detect it (e.g. via hasTaxRateWithMatchingValue/getTaxName returning empty for a present taxCode) and either surface the existing tax-disabled/clear alert or clear taxCode/taxAmount/taxValue before building the save payload, so a deleted tax code is never sent to the API in SplitTransactionUpdate.ts.


    view run

  9. 16 remaining items

  10. truph01 commented on Aug 28, 2026

    @truph01
    Contributor

    Not overdue

  11. hoangzinh commented on Aug 28, 2026

    @hoangzinh
    Contributor

    @luacmartins can you help to close this issue? It is a regression of this original issue #94038, and I think we will be paid centrally later in the original issue.

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Aug 28, 2026
  13. melvin-bot commented on Aug 28, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Aug 28, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  15. melvin-bot commented on Aug 31, 2026

    @melvin-bot

    @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  16. hoangzinh commented on Sep 1, 2026

    @hoangzinh
    Contributor

    @luacmartins can you help to close this issue? It is a regression of this original issue #94038, and I think we will be paid centrally later in the original issue.

    @mallenexpensify ☝️ I think we don't need a payment on this separate issue.

  17. luacmartins commented on Sep 1, 2026

    @luacmartins
    Contributor

    Sounds good. Closing.

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

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions