Skip to content

Expense - Invalid amount error does not show up when amount is 0 when paying user #90654

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.74-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: #87920
Email or phone of affected tester (no customers): sdsdjoijdoisnjodis@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:

  • Run Onyx.merge('betas', ['newManualExpenseFlow']); in console.
  1. Go to staging.new.expensify.com
  2. Open DM with any user.
  3. Click + > Pay.
  4. Enter amount > Next.
  5. On confirm page, change the amount to 0.
  6. Click Mark as paid.

Expected Result:

Invalid amount error will show up because amount is 0.

Actual Result:

Invalid amount error does not show up when amount is 0 when paying user.

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

Activity

  1. added
    DeployBlockerCash
    Bug
    on May 14, 2026
  2. melvin-bot commented on May 14, 2026

    @melvin-bot

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

  3. melvin-bot commented on May 14, 2026

    @melvin-bot

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

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

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #87920 - "Feat: Manual expense flow UI refactor - r3" by @ChavdaSachin (High confidence)
    Related Issues: #82586

    Recommendation: REVERT

    PR #87920 introduced a regression in the amount validation for the PAY flow (the "Mark as paid" path). The zero-amount guard in useConfirmationValidation.ts explicitly excludes iouType === CONST.IOU.TYPE.PAY, so when a user changes the amount to 0 on the confirm page and clicks "Mark as paid", no invalid-amount error is raised.

    Assigned: @ChavdaSachin (PR author), @ShridharGoel and @puneetlath (approving reviewers)
    Labels: DeployBlockerCash kept (frontend App PR caused this). No label changes made.

    Detailed Analysis

    Evidence

    Verification

    • Affected file: src/components/MoneyRequestConfirmationList/hooks/useConfirmationValidation.ts
    • PR Feat: Manual expense flow UI refactor - r3 #87920 directly modifies this file.
    • The PR rewrote the amount validation logic at lines 162-168 of the current file.

    Root Cause

    In useConfirmationValidation.ts, the zero-amount guard added by the PR reads:

    // P2P manual submit: $0 is invalid unless scan/time/distance
    if (iouType !== CONST.IOU.TYPE.PAY && !isScanRequestUtil(transaction) && !isTimeRequest && !isDistanceRequest && iouAmount === 0 && isP2P) {
        return {errorKey: 'common.error.invalidAmount'};
    }

    The iouType !== CONST.IOU.TYPE.PAY condition explicitly skips zero-amount validation for the Pay/Send Money flow. When the user opens a DM, clicks + > Pay, sets an amount, navigates to the confirm page, changes the amount to 0, and clicks "Mark as paid", the iouType is PAY so the guard above is bypassed entirely. The second guard (!transaction?.isAmountSet) also does not catch this because the user explicitly set the amount (to 0), so isAmountSet is true. As a result, no validation error is shown and the payment proceeds with an invalid $0 amount.

  6. MelvinBot commented on May 14, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The amount=0 validation in useConfirmationValidation.ts:163 explicitly excludes PAY flows:

    if (iouType !== CONST.IOU.TYPE.PAY && ... && iouAmount === 0 && isP2P) {
        return {errorKey: 'common.error.invalidAmount'};
    }
    

    When the user clicks "Mark as paid", iouType is CONST.IOU.TYPE.PAY, so the condition short-circuits and the $0 check is skipped. The PAY branch (lines 257-261) only validates that a payment method is selected — it has no amount check at all, so onSendMoney fires with amount=0.

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

    Remove iouType !== CONST.IOU.TYPE.PAY from the guard on line 163 so the amount=0 check applies to PAY flows as well:

    if (!isScanRequestUtil(transaction) && !isTimeRequest && !isDistanceRequest && iouAmount === 0 && isP2P) {
        return {errorKey: 'common.error.invalidAmount'};
    }
    

    This ensures PAY transactions get the same invalidAmount error as other P2P flows when the user sets the amount to 0.


    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. ChavdaSachin commented on May 14, 2026

    @ChavdaSachin
    Contributor

    Working on a CP

  8. added
    Reviewing
    on May 14, 2026
  9. added a commit that references this issue on May 14, 2026
    dc23243
  10. IuliiaHerets commented on May 14, 2026

    @IuliiaHerets

    Mac/ Chrome
    v9.3.74-3
    Not Repro

    Repro.-.90654.mp4
  11. removed
    DeployBlockerCash
    on May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugEngineeringHourlyReviewing

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions