Skip to content

[$250] Expenses - Unable to create an expense after selecting a valid tax rate #80192

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: v9.3.6-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: #78358
Email or phone of affected tester (no customers): agexptest+pr210126@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 11/ Chrome, Samsung S23FE/ Android 16, iPhone 13 Mini/ iOS 26.1
App Component: Money Requests

Action Performed:

Prerequisites: Have two workspaces with taxes enabled. One of them is the default workspace.
Add a new tax rate to the default workspace.

  1. Launch the Expensify app
  2. Go to selfDM
  3. Create a new tracked expense
  4. Set the tax rate to the newly created one
  5. Tap on Submit to someone
  6. Choose a different workspace with tax enabled
  7. Fill in the merchant if needed
  8. Tap on "Create X expense"
  9. Verify that you see the error for the tax rate
  10. Change the tax rate
  11. Verify that after changing the tax rate no error appears and you can submit the expense

Expected Result:

The error message disappears, and the expense is successfully created.

Actual Result:

Unable to create an expense due to the error message.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022014263718904725186
  • Upwork Job ID: 2014263718904725186
  • Last Price Increase: 2026-01-22
Issue OwnerCurrent Issue Owner: @

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on Jan 22, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  5. github-actions commented on Jan 22, 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.
  6. OSBotify commented on Jan 22, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #78358 - "fix: revert revert taxes field" by @koko57 (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #78358 should be reverted. While it adds important tax validation for track expenses, it has a critical bug where tax validation errors are not cleared when the user selects a valid tax rate, making it impossible to submit expenses.

    Labels: Removing DeployBlocker since this is a frontend bug. Keeping DeployBlockerCash.

    📋 Detailed Analysis

    Evidence

    PR #78358 introduced tax tracking functionality for expenses being moved from track expenses to workspaces. The issue occurs in the exact scenario described in the PR's test plan (step 10-12 of the "Submitting the expense to a different workspace with taxes enabled" section).

    Verification

    The bug is in /src/components/MoneyRequestConfirmationList.tsx:

    Lines 970-973 - Tax validation that sets the error:

    if (shouldShowTax && !!transaction.taxCode && !Object.keys(policy?.taxRates?.taxes ?? {}).some((key) => key === transaction.taxCode)) {
        setFormError('violations.taxOutOfPolicy');
        return;
    }

    Lines 458-461 - Example of clearing violations when user fixes them:

    const isMissingAttendeesViolation = getIsMissingAttendeesViolation(...);
    if (formError === 'violations.missingAttendees' && !isMissingAttendeesViolation) {
        setFormError('');
    }

    Missing logic: There is NO equivalent code to clear violations.taxOutOfPolicy when the user changes to a valid tax rate.

    Root Cause

    PR #78358 added validation to check if a tax rate from one workspace exists in another workspace (line 970). However, it failed to add the corresponding cleanup logic in the useEffect (around lines 441-463) to clear the violations.taxOutOfPolicy error when the user fixes the issue by selecting a valid tax rate.

    The error persists because violation errors starting with CONST.VIOLATIONS_PREFIX are intentionally preserved across focus changes (line 453), but there's no logic to clear them when the underlying issue is resolved, unlike the violations.missingAttendees case.

    This is a missing validation-clearing pattern that exists for other violations but was not implemented for the tax validation.

  7. koko57 commented on Jan 22, 2026

    @koko57
    Contributor

    @parasharrajat were you be able to look into this persistent error issue we had for the category field on staging?

  8. parasharrajat commented on Jan 22, 2026

    @parasharrajat
    Member

    These errors happen with the Category field as well as reported on the PR. @cristipaval We should add that too, and remove DP.

  9. 2 remaining items

  10. cristipaval commented on Jan 22, 2026

    @cristipaval
    Contributor

    Yes, this is a known bug that happens to the other fields as well. I'll demote it for now. We'll work on it with urgency.

  11. added
    ExternalAdded to denote the issue can be worked on by a contributor
    and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jan 22, 2026
  12. changed the title [-]Expenses - Unable to create an expense after selecting a valid tax rate[/-] [+][$250] Expenses - Unable to create an expense after selecting a valid tax rate[/+] on Jan 22, 2026
  13. melvin-bot commented on Jan 22, 2026

    @melvin-bot
  14. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 22, 2026
  15. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    Current assignee @parasharrajat is eligible for the External assigner, not assigning anyone new.

  16. koko57 commented on Jan 22, 2026

    @koko57
    Contributor

    this issue can be closed - it has the same root cause as #79902, so it could be handled there. I left my findings in that issue #79902 (comment)

  17. koko57 commented on Jan 23, 2026

    @koko57
    Contributor

    It's a regression from #79050 - confirmed here #79902 (comment)

    cc @cristipaval @parasharrajat

  18. cristipaval commented on Jan 23, 2026

    @cristipaval
    Contributor

    Closing, since this is a dupe of #79902

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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions