Skip to content

Expense - Tax fields are shown in IOU expense after submitting it from self DM #87616

Closed

Description

@jponikarchuk

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.58-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: #84769
Email or phone of affected tester (no customers): sjdiosjondoidosd@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 a manual expense with tax.
  4. Click Submit it to someone.
  5. Select a user (not workspace).
    → Tax fields are not shown on confirm page.
  6. Click Create expense.
  7. Open the IOU expense.
    → Tax fields are shown on confirm page.

Expected Result:

Tax fields should be hidden in IOU expense.

Actual Result:

Tax fields are shown in IOU expense after submitting it from self DM.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @dominictb

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Apr 10, 2026

    @melvin-bot

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

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

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #84769 - "Show an alert and allow to delete tax if tax tracking is disabled in the workspace" by @dominictb (High confidence)
    Related Issues: #70058, #83157

    Recommendation: REVERT

    PR #84769 introduced a logic regression in shouldShowTax that makes tax fields visible on IOU expenses (person-to-person) when they should be hidden. Reverting this PR is the cleanest path to restore correct behavior.

    Assigned: @dominictb (PR author), @hoangzinh, @youssef-lr, @trjExpensify (approving reviewers)
    Labels: No label changes — DeployBlockerCash is correctly set; this is a Frontend bug caused by an App PR.

    Detailed Analysis

    Evidence

    The issue is staging-only (not reproducible in production), confirmed to be caused by a change in the current staging release (9.3.58-0). The melvin-bot and the StagingDeployCash checklist both confirm PR #84769 is part of this release (merged 2026-04-09).

    The bug reproduces specifically when:

    1. A manual expense with tax is created in a self DM (or from a workspace with taxes enabled)
    2. It is submitted to a person (not a workspace) via "Submit it to someone"
    3. After creating the IOU expense, tax fields appear on the expense view -- they should not

    Verification

    The affected file is src/components/ReportActionItem/MoneyRequestView.tsx, which PR #84769 directly modifies (47 additions, 2 deletions to this file).

    Root Cause

    Before PR #84769, the tax visibility logic was:

    shouldShowTax = isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, ...) || !!transaction?.taxName
    

    After PR #84769, the logic became:

    isTaxEnabled = isTaxTrackingEnabled(isPolicyExpenseChat || isExpenseUnreported, policy, ...)
    shouldShowTaxDisabledAlert = !isTaxEnabled && !!transaction?.taxCode
    shouldShowTax = isTaxEnabled || !!transaction?.taxName || shouldShowTaxDisabledAlert
    

    For an IOU expense (submitted to a person, not a workspace):

    • isPolicyExpenseChat = false (the IOU report is not in a group policy)
    • isExpenseUnreported = false (it has a valid reportID, not the unreported sentinel ID)
    • Therefore isTaxEnabled = false

    If the transaction carries a taxCode from when it was originally created in a workspace with tax tracking enabled, then shouldShowTaxDisabledAlert evaluates to true, which causes shouldShowTax to be true -- incorrectly displaying tax fields in the IOU expense view.

    The PR was intended to show a "Tax disabled" alert for expenses moved into non-tax workspaces, but the shouldShowTaxDisabledAlert condition (!isTaxEnabled && !!transaction?.taxCode) does not distinguish between "expense in a non-tax workspace" and "IOU expense with a person", making it fire in the wrong context.

  6. MelvinBot commented on Apr 10, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #84769 modified the shouldShowTax logic in MoneyRequestView.tsx:454-456 to:

    const shouldShowTax = isTaxEnabled || !!transaction?.taxName || shouldShowTaxDisabledAlert;
    

    The intent was to show tax fields (with an "invalid" violation) when a taxed transaction is merged/moved into a non-tax workspace. However, the fallback conditions (!!transaction?.taxName and shouldShowTaxDisabledAlert = !isTaxEnabled && !!transaction?.taxCode) are not gated to workspace expenses. They fire for any transaction that carries tax data — including personal IOUs between users.

    When a user creates a taxed expense in self DM and submits it to another user (not a workspace), the transaction retains its taxName and taxCode from the original context. Since the IOU has no workspace, isTaxEnabled is correctly false, but the fallbacks make shouldShowTax evaluate to true.

    Note: the confirmation page (MoneyRequestConfirmationList.tsx:343) correctly uses only isTaxTrackingEnabled(...) without fallbacks, which is why tax fields are hidden on the confirm step but appear after the expense is created.

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

    Gate the fallback conditions in MoneyRequestView.tsx so they only apply to workspace expenses (where the merge/move scenario is relevant):

    const shouldShowTax = isTaxEnabled || ((isPolicyExpenseChat || isExpenseUnreported) && (!!transaction?.taxName || shouldShowTaxDisabledAlert));
    

    This ensures:

    What alternative solutions did you explore? (Optional)

    An alternative would be to clear taxName/taxCode from the transaction when submitting to a non-workspace user, but that changes the data layer and could cause issues if the expense is later moved to a tax-enabled workspace. The UI-level guard is simpler and consistent with how the confirmation page already handles this.


    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. trjExpensify commented on Apr 10, 2026

    @trjExpensify
    Contributor

    @dominictb I think the tax should be cleared from the transaction when you take this action, as shown in the confirmation step here without tax included:

    Image

    As this is P2P/IOU which nobody is using really apart from some internal folks, I think you can demote this as well.

  8. 11 remaining items

  9. trjExpensify commented on Apr 20, 2026

    @trjExpensify
    Contributor

    @dominictb @youssef-lr what's the latest here?

  10. melvin-bot commented on Apr 20, 2026

    @melvin-bot

    @dominictb Huh... This is 4 days overdue. Who can take care of this?

  11. dominictb commented on Apr 21, 2026

    @dominictb
    Contributor

    Backend PR ☝️

  12. melvin-bot commented on Apr 24, 2026

    @melvin-bot

    @hoangzinh @youssef-lr @trjExpensify @dominictb this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  13. melvin-bot commented on Apr 24, 2026

    @melvin-bot

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

  14. dominictb commented on Apr 27, 2026

    @dominictb
    Contributor

    @youssef-lr is reviewing the PR

  15. dominictb commented on Apr 28, 2026

    @dominictb
    Contributor

    PR is merged. Awaiting deploy

  16. dominictb commented on Apr 29, 2026

    @dominictb
    Contributor

    PR reaches prod. Closed as fixed.

    Screen.Recording.2026-04-29.at.18.00.34.mov
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.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staff

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions