Skip to content

[Due for payment 2026-06-19] [Due for payment 2026-06-18] Expense - No error when tax amount exceeds the limit #93236

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.5-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: #92161
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:

  • Enable Taxes in workspace settings.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Click + > Create expense > Manual.
  4. Enter amount > Next.
  5. On confirm page, click Tax amount.
  6. Enter a large amount and save it.

Expected Result:

Error will show up when tax amount exceeds the limit.

Actual Result:

Error does not show up when tax amount exceeds the limit and it can be saved.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7177431_1781135644919.10.mp4

View all open jobs on GitHub

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

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 11, 2026
  2. applause-bot commented on Jun 11, 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/a9aaa4033303a32c5071985231845dabe1cdc15c9def585d2f267a2e14a51454

  3. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

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

    @MelvinBot
    Contributor

    Proposal

    Posted by 🤖 MelvinBot — confidence: High (deterministic routing/string-match regression, code evidence below).

    What is the root cause of that problem?

    The tax-amount validation is gated on a substring check of the active route URL, and PR #92161 renamed that route from camelCase taxAmount to kebab-case tax-amount, so the check now always returns false.

    In MoneyRequestAmountForm.tsx:171 the form decides whether it is the tax form via:

    const isTaxAmountForm = Navigation.getActiveRouteWithoutParams().includes('taxAmount');

    The over-limit error is only raised when isTaxAmountForm is true (MoneyRequestAmountForm.tsx:180):

    if (isTaxAmountForm && isTaxAmountInvalid(currentAmount, taxAmount, getCurrencyDecimals(currency))) {
        setFormError(translate('iou.error.invalidTaxAmount', formattedTaxAmount));
        return;
    }

    PR #92161 (deploy blocker source) migrated the route. The path changed from :action/:iouType/taxAmount/... to money-request/tax-amount/:action/.... The active URL no longer contains the substring taxAmount, so isTaxAmountForm is permanently false → the limit check is skipped and any amount saves. This exactly matches the reported symptom (regresses in staging, not yet in production).

    Secondary effect worth verifying

    The same flag also guards MoneyRequestAmountForm.tsx:175 (!isTaxAmountForm && isAmountInvalid(...)), whose comment notes that 0 is a valid tax input. With isTaxAmountForm now false, entering 0 as a tax amount may incorrectly raise invalidAmount. Worth checking while fixing the primary bug.

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

    Stop string-matching the route to detect the tax form. The tax-amount page already knows it is the tax form, so pass an explicit isTaxAmountForm prop from DynamicIOURequestStepTaxAmountPage into MoneyRequestAmountForm and use that instead of the getActiveRouteWithoutParams().includes('taxAmount') check. This is robust to future route renames.

    If a minimal fix is preferred over the prop approach, update the substring to the new kebab-case route (.includes('tax-amount')), but the explicit prop is safer since it removes the URL-string coupling entirely.

    What alternative solutions did you explore? (Optional)

    None needed — the regression is a direct, deterministic consequence of the route rename in #92161.


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

  7. huult commented on Jun 11, 2026

    @huult
    Contributor

    @MelvinBot

    const isTaxAmountForm = Navigation.getActiveRouteWithoutParams().includes('taxAmount');

    Since we updated taxAmount to tax-amount, I think we should keep the existing check and update it to use the new parameter like this.

    - const isTaxAmountForm = Navigation.getActiveRouteWithoutParams().includes('taxAmount');
    + const isTaxAmountForm = Navigation.getActiveRouteWithoutParams().includes('money-request/tax-amount');

    If possible, could we create a constant for this?

    @MelvinBot implement this to create a draft PR.

  8. MelvinBot commented on Jun 11, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #93251
    Please mark it as "Ready for review" when it is ready for review.

    What it does: Adds CONST.IOU.TAX_AMOUNT_ROUTE_PREFIX = 'money-request/tax-amount' and updates the tax-form detection in MoneyRequestAmountForm.tsx:171 to check for that prefix (the route was renamed from taxAmount to money-request/tax-amount in #92161, which silently disabled the over-limit validation). Also adds a regression test tying the constant to the generated route.

    Note: I pushed to an upstream branch because huult doesn't have push access to their fork — see the take-ownership instructions on the PR.

    AI tests run locally
    • npm run lint-changed — passed
    • npm run typecheck-tsgo — passed (CI gate is tsc)
    • npm run prettier — already formatted
    • react-compiler-compliance-check check src/pages/iou/MoneyRequestAmountForm.tsx — COMPILED
    • npm test tests/unit/TaxAmountRoutePrefixTest.ts — 2 passed
    • Not run in this environment: full npm run lint and Storybook smoke test (memory-limited here; change touches no stories). UI verification of the tax-limit flow requires a Taxes-enabled paid workspace and was left to QA.
  9. mjasikowski commented on Jun 11, 2026

    @mjasikowski
    Contributor

    PR reverted

  10. 3 remaining items

  11. changed the title [-]Expense - No error when tax amount exceeds the limit[/-] [+][Due for payment 2026-06-18] Expense - No error when tax amount exceeds the limit[/+] on Jun 11, 2026
  12. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

  13. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

  14. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

  15. changed the title [-][Due for payment 2026-06-18] Expense - No error when tax amount exceeds the limit[/-] [+][Due for payment 2026-06-19] [Due for payment 2026-06-18] Expense - No error when tax amount exceeds the limit[/+] on Jun 12, 2026
  16. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.6-4 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-19. 🎊

  17. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    @mjasikowski 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. mjasikowski commented on Jun 15, 2026

    @mjasikowski
    Contributor

    No checklist needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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