Skip to content

[Due for payment 2026-06-17] [Due for payment 2026-06-16] Expense - Tax amount error field persists when tax amount does not exceed limit #92820

Closed

Description

@applause-bot

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.4.0-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: #92059
Email or phone of affected tester (no customers): jsodinjosdjsoinjsiojs@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:

  • Run Onyx.merge('betas', ['newManualExpenseFlow']); in console.
  • Enable Taxes in workspace settings.
  • Create 5% and 10% tax rate.
  • Set 5% tax rate as Workspace currency default.
  • Set 10% tax rate as Foreign currency default.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Click + > Create expense > Manual.
  4. Enter amount 10.
  5. Enter tax amount 0.90.
  6. Enter merchant.
  7. Click Create expense.
  8. Change amount currency to foreign currency.

Expected Result:

Tax amount error field should dismiss because the current entered field is 0.90 which is below 0.91 limit.

Actual Result:

Tax amount error field persists when tax amount does not exceed limit.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7172891_1780684016581.11.mp4

View all open jobs on GitHub

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

Issue OwnerCurrent Issue Owner: @dukenv0307

Activity

  1. applause-bot commented on Jun 5, 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/edd29950cf9194c58c9339144942d44d6b16180a76fd29ba85b728c376c573e4

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

    @melvin-bot

    @JS00001 recently merged #92059, but they are OOO right now, so I'll auto-assign someone else.

  4. melvin-bot commented on Jun 5, 2026

    @melvin-bot

    Triggered auto assignment to @lakchote (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Jun 5, 2026

    @melvin-bot

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

  6. github-actions commented on Jun 5, 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.
  7. MelvinBot commented on Jun 5, 2026

    @MelvinBot
    Contributor

    Proposal

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

    In the new manual expense flow (newManualExpenseFlow beta), the inline tax amount error (Tax amount cannot be more than X) persists after the user changes the expense currency, even though the new currency raises the tax limit enough to make the entered tax amount valid. The error should clear once the tax amount no longer exceeds the limit.

    What is the root cause of that problem?

    The tax limit is computed from both the expense amount and the currency (via getCalculatedTaxAmount, which also picks up the currency's default tax rate). But the iou.error.invalidTaxAmount form error is stale state that is only cleared when the tax amount field itself is edited — never when the currency or expense amount changes.

    The error display is driven purely by the form-error string, not by current validity:

    The currency change handler updates the amount/currency but only clears amount errors, not the tax error:

    So after the currency change, the tax limit recalculates and getCalculatedTaxAmount now permits the entered amount, but nothing re-runs validation or clears the stale error. Validation (which would clear it) only re-runs on submit — useConfirmationValidation.ts:254-261.

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

    Clear the stale tax error whenever an input that feeds the tax limit changes. In AmountField.tsx, add 'iou.error.invalidTaxAmount' to the clearFormErrors calls in both updateCurrency and handleAmountChange:

    // in updateCurrency (currently clears nothing)
    clearFormErrors(['iou.error.invalidTaxAmount']);
    
    // in handleAmountChange
    clearFormErrors(['common.error.invalidAmount', 'common.error.fieldRequired', 'iou.error.invalidTaxAmount']);

    This mirrors the existing pattern (TaxFields.handleTaxAmountChange already clears it on tax edit) — the tax amount is re-validated on submit, so optimistically clearing the stale error when its limit changes is safe and consistent.

    What alternative solutions did you explore?

    Instead of imperatively clearing on each handler, derive the error live: add a useEffect in TaxFields that re-runs isTaxAmountInvalid and clears iou.error.invalidTaxAmount whenever effectiveCurrency/maxTaxAmount/tax amount change. This is more robust against future inputs that affect the limit, but heavier than the targeted handler change above.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/92820) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  8. godzillaxbox19982014-lgtm commented on Jun 6, 2026

    @godzillaxbox19982014-lgtm

    Proposal

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

    Expense - Tax amount error field persists when tax amount does not exceed limit

    What is the root cause of that problem?

    I traced this to the path that handles selected currency, workspace name, expense report:

    • src/libs/ReportUtils.ts:11511 (createDraftWorkspaceAndNavigateToConfirmationScreen): return createDraftWorkspaceAndNavigateToConfirmationScreen(introSelected, transactionID, actionName, '', currentUserAccountID, currentUserEmail, currentUserLocalCurrency);
    • src/libs/actions/IOU/types/TrackedExpenseParams.ts:65 (matching code path): createdWorkspaceParams?: CreateWorkspaceParams;
    • src/libs/actions/IOU/TrackExpense.ts:8 (matching code path): CreateWorkspaceParams,
    • The local evidence matches this recurring failure shape: optimistic transaction/report data is written to one Onyx key but the visible list reads another derived key. Here, src/libs/ReportUtils.ts:11511 and src/libs/actions/IOU/types/TrackedExpenseParams.ts:65 do not agree on the same selected currency, workspace name, expense report value, so the user-visible path can show a missing or stale state even though nearby data already has the needed context.

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

    • Update src/libs/ReportUtils.ts:11511 to derive selected currency, workspace name, expense report from the report/transaction source that owns this flow before the value is consumed.
    • Carry the same normalized value through src/libs/actions/IOU/types/TrackedExpenseParams.ts:65; that follows the safer family move to align optimistic/success/failure data with the selector consumed by the screen, so the write/optimistic/read paths agree instead of only changing the visible component.
    • Keep the change inside the Reports, Expenses, IOU, Transactions surface and avoid changing payment actions, personal/deleted policies.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    1. Add or update a regression in tests/unit/ReportUtils*.ts for the exact issue flow: Expense - Tax amount error field persists when tax amount does not exceed limit.
    2. Cover the counter-case near src/libs/ReportUtils.ts:11511 so valid existing selected currency, workspace name, expense report behavior still works.
    3. Manually repeat the issue steps after the patch and confirm the visible state/action is no longer stale.

    What alternative solutions did you explore? (Optional)

    • I would not add a broad new condition outside these referenced paths; the safer fix is to keep selected currency, workspace name, expense report consistent at the first read/write boundary shown above.
  9. lakchote commented on Jun 8, 2026

    @lakchote
    Contributor

    Not overdue - deploy blocker triage is active and the tax validation path is under investigation.

  10. 5 remaining items

  11. m-natarajan commented on Jun 9, 2026

    @m-natarajan

    issue not reproducible using Staging v9.4.0-5.
    after step 7 , violation appear under tax field

    Screen.Recording.2026-06-09.at.7.38.43.AM.mov
  12. Julesssss commented on Jun 9, 2026

    @Julesssss
    Contributor

    after step 7 , violation appear under tax field

    Resolved blocker as main issue fixed and it's a new feature.

  13. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Jun 9, 2026
  14. changed the title [-]Expense - Tax amount error field persists when tax amount does not exceed limit[/-] [+][Due for payment 2026-06-16] Expense - Tax amount error field persists when tax amount does not exceed limit[/+] on Jun 9, 2026
  15. melvin-bot commented on Jun 9, 2026

    @melvin-bot

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

  16. melvin-bot commented on Jun 9, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.0-7 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-06-16. 🎊

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

    • @dukenv0307 requires payment through NewDot Manual Requests
  17. melvin-bot commented on Jun 9, 2026

    @melvin-bot

    @dukenv0307 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]. If no checklist is needed for this issue, you can click: [no checklist button]

  18. changed the title [-][Due for payment 2026-06-16] Expense - Tax amount error field persists when tax amount does not exceed limit[/-] [+][Due for payment 2026-06-17] [Due for payment 2026-06-16] Expense - Tax amount error field persists when tax amount does not exceed limit[/+] on Jun 10, 2026
  19. melvin-bot commented on Jun 10, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.1-6 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-06-17. 🎊

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

    • @dukenv0307 requires payment through NewDot Manual Requests
  20. melvin-bot commented on Jun 10, 2026

    @melvin-bot

    @dukenv0307 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]. If no checklist is needed for this issue, you can click: [no checklist 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