Skip to content

Expense - No error shows up when 0.00 amount when bulk editing invoice expenses #84665

Closed

Description

@mitarachim

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.34-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: #82948
Email or phone of affected tester (no customers): jdofinjdoinjidfojdo@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 Invoices.
  1. Go to staging.new.expensify.com
  2. Open FAB > Send invoice.
  3. Send an invoice to any user.
  4. Send another invoice to the same user.
  5. Go to Reports > Expenses.
  6. Click Type > Invoice > Apply.
  7. Bulk select both expenses.
  8. Click dropdown button > Edit multiple.
  9. Click Amount.
  10. Enter 0 and save it.
  11. Click Save.

Expected Result:

Error will show up when saving 0.00 amount when bulk editing invoice expenses because 0.00 amount is not allowed when sending/editing invoice.

Actual Result:

No error shows up when 0.00 amount when bulk editing invoice expenses.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7098319_1773098199672.9.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    Daily
    on Mar 10, 2026
  2. added
    Bug
    DeployBlocker
    on Mar 10, 2026
  3. melvin-bot commented on Mar 10, 2026

    @melvin-bot

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

  4. melvin-bot commented on Mar 10, 2026

    @melvin-bot

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

  5. melvin-bot commented on Mar 10, 2026

    @melvin-bot

    Triggered auto assignment to @laurenreidexpensify (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.

  6. github-actions commented on Mar 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.
  7. OSBotify commented on Mar 10, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #82948 - "Reapply "Feat: bulk edit multiple"" by @pasyukevich (High confidence)
    Related Issues: #75617

    Recommendation: ROLL FORWARD

    The fix is straightforward and localized - the bulk edit amount page needs to pass the iouType prop to the MoneyRequestAmountForm component. The existing validation logic already handles invoice zero-amount validation correctly; it just needs the proper iouType to be passed through.

    A revert would remove the entire bulk edit feature (which includes 25+ test scenarios), whereas the fix is a single prop addition. Rolling forward is more appropriate here.

    Labels: Keeping DeployBlockerCash (App PR caused the issue). Removing DeployBlocker (this is a frontend bug, not a backend issue).

    📋 Detailed Analysis

    Evidence

    The issue reports that bulk editing invoice expenses allows setting amount to 0.00, when it should show an error (as it does for IOU expenses in Test 16 of the PR).

    PR #82948 introduced the bulk edit feature, including SearchEditMultipleAmountPage.tsx which handles amount editing for multiple expenses.

    Verification

    File affected: /home/runner/_work/App/App/src/pages/Search/SearchEditMultiple/SearchEditMultipleAmountPage.tsx

    Confirmed the PR modifies this file: ✅ This file was newly added in PR #82948

    Code analysis:

    1. Line 77 in SearchEditMultipleAmountPage.tsx correctly determines the iouType:

      const iouType = isInvoiceReport(iouReport) ? CONST.IOU.TYPE.INVOICE : CONST.IOU.TYPE.SUBMIT;
    2. However, this iouType is only used locally (line 78) and is never passed to the MoneyRequestAmountForm component (lines 125-140).

    3. In MoneyRequestAmountForm.tsx (line 90), when iouType is not provided, it defaults to CONST.IOU.TYPE.SUBMIT.

    4. The validation logic (lines 61-76 in MoneyRequestAmountForm.tsx) checks if iouType is in nonZeroExpenses set:

      const nonZeroExpenses = new Set([CONST.IOU.TYPE.PAY, CONST.IOU.TYPE.INVOICE, CONST.IOU.TYPE.SPLIT]);
    5. Since CONST.IOU.TYPE.SUBMIT is NOT in this set, the validation that prevents 0.00 amounts for invoices never triggers.

    Root Cause

    The bulk edit amount page calculates the correct iouType for invoice detection but fails to pass it as a prop to the MoneyRequestAmountForm component. This causes the form to use the default SUBMIT type, bypassing the zero-amount validation that should apply to invoices.

    Fix: Add iouType prop to MoneyRequestAmountForm in SearchEditMultipleAmountPage.tsx (similar to how isP2P is already passed on line 129).

  8. removed
    DeployBlocker
    on Mar 10, 2026
  9. MelvinBot commented on Mar 10, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When bulk editing invoice expenses via Search > Expenses > Edit multiple > Amount, entering 0.00 does not show an error. However, editing an individual invoice expense amount to 0.00 correctly shows "Please enter a valid amount before continuing." Invoice expenses should never allow zero amounts, regardless of whether edited individually or in bulk.

    What is the root cause of that problem?

    SearchEditMultipleAmountPage.tsx renders MoneyRequestAmountForm without passing the iouType prop (line 125-139). Because of this, MoneyRequestAmountForm defaults iouType to CONST.IOU.TYPE.SUBMIT (line 90 of MoneyRequestAmountForm.tsx).

    The zero-amount validation in MoneyRequestAmountForm.tsx (lines 61-76) only rejects amounts < 0.01 for types in the nonZeroExpenses set (PAY, INVOICE, SPLIT). Since SUBMIT is not in that set, the check on line 71 never triggers, and zero amounts pass validation for invoice expenses in bulk edit.

    In contrast, the individual edit flow (MoneyRequestView.tsx → IOURequestStepAmount.tsx) correctly passes iouType=INVOICE through route params, so the same validation catches zero amounts.

    Notably, SearchEditMultipleAmountPage.tsx already computes the correct iouType per transaction at line 77 (isInvoiceReport(iouReport) ? CONST.IOU.TYPE.INVOICE : CONST.IOU.TYPE.SUBMIT) — but only uses it for the allowNegative calculation, not for the form's amount validation.

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

    In SearchEditMultipleAmountPage.tsx, compute the most restrictive iouType across all selected transactions (if any selected transaction is an invoice, use CONST.IOU.TYPE.INVOICE) and pass it as the iouType prop to MoneyRequestAmountForm. The existing useMemo that computes allowNegative and isP2P already iterates over selected transactions and checks isInvoiceReport — this same loop should also derive the appropriate iouType to pass to the form component.

    What alternative solutions did you explore? (Optional)

    An alternative would be adding validation in the saveAmount callback or in SearchEditMultiplePage.tsx's save() function. However, this would mean duplicating the validation logic that already exists in MoneyRequestAmountForm. The cleaner approach is to pass the correct iouType so the existing validation applies naturally — matching how individual edit works.


    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.

  10. added
    Reviewing
    on Mar 10, 2026
  11. IuliiaHerets commented on Mar 10, 2026

    @IuliiaHerets

    Chrome / 9.3.34-1
    No Edit multiple option

    Screen.Recording.2026-03-10.at.19.46.18.mp4
  12. removed
    DeployBlockerCash
    on Mar 10, 2026
  13. marcaaron commented on Apr 3, 2026

    @marcaaron
    Contributor

    Fixed in #84756

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