Skip to content

Split - Two "Invalid amount" errors are shown #96565

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.41-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: #96228
Email or phone of affected tester (no customers): sdsjodijnsdojsosjio@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:

  1. Go to staging.new.expensify.com
  2. Open 1:1 DM.
  3. Click + > Split expense > Manual.
  4. Click Split.

Expected Result:

Only one "Invalid amount" error will be shown.

Actual Result:

Two "Invalid amount" errors are shown.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7213110_1784601828695.10.mp4

View all open jobs on GitHub

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

Activity

  1. applause-bot commented on Jul 21, 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/8d58dcd5ac589966165fabfa7e2df98c03c16d928974935bc457e2df3f9c4a0c

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

    @melvin-bot

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

  4. melvin-bot commented on Jul 21, 2026

    @melvin-bot

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

  5. github-actions commented on Jul 21, 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 Jul 21, 2026

    @MelvinBot
    Contributor

    Proposal

    Root Cause

    The Split confirmation screen renders the same common.error.invalidAmount error in two places at once:

    1. Inline on the amount input via AmountField.tsx:105-112 — shouldShowAmountInvalidError sets the field's errorText.
    2. At the bottom of the form (FormHelpMessage) via the split branch in useFormErrorManagement.ts:234-236.

    computeErrorMessage already has a guard that suppresses the footer copy of invalidAmount precisely because the input surfaces it inline (useFormErrorManagement.ts:250-255) — but the isTypeSplit branch returns early at line 234 before that guard runs, so for splits the footer error is never suppressed and the message shows twice.

    This is a regression from #96228 (feat: remove isNewManualExpenseFlowEnabled beta flag). Before the flag was removed, the split amount was not an editable inline input showing this error, so the footer error was the only one. Now the new manual flow renders the editable AmountField for splits too, making the footer copy a duplicate.

    Recommended Fix

    Let the split branch fall through the same inline-suppression the non-split path uses. Add the invalidAmount (and, for consistency, fieldRequired) guard inside the split branch in useFormErrorManagement.ts:234-236:

    if (isTypeSplit && !shouldShowReadOnlySplits) {
        // These are surfaced inline on the editable amount input in the new manual flow, so don't repeat them here.
        if (!isDistanceRequest && (formError === 'common.error.invalidAmount' || formError === 'common.error.fieldRequired')) {
            return undefined;
        }
        return debouncedFormError ? translate(debouncedFormError) : undefined;
    }

    Keep the inline AmountField error as the primary surface (it's the intended one for the new flow); the footer copy is the redundant one.

    Investigation details
    • Error origin: useConfirmationValidation.validate() returns common.error.invalidAmount, and confirmAction.ts calls setFormError('common.error.invalidAmount') on Split.
    • That single formError then drives both the inline AmountField render and the footer FormHelpMessage.
    • Alternative considered: removing the inline error on AmountField instead — rejected, since the hook's own doc comments make clear the inline field is the intended primary surface and the footer is the redundant one.
    • Line numbers verified against the merge commit 47f67e5 of feat: remove isNewManualExpenseFlowEnabled beta flag #96228.
    • Confidence: high — deterministic UI logic; the dedupe intent is documented in-code. Best confirmed by manual repro (Split > Manual > Split with empty amount) or a component test.

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

  7. trjExpensify commented on Jul 21, 2026

    @trjExpensify
    Contributor

    Can reproduce, we don't need the footer value. IOU P2P split flow though, so minor in priority. I vote demote.

  8. yuwenmemon commented on Jul 21, 2026

    @yuwenmemon
    Contributor

    The offending PR that caused this deploy blocker was reverted with #96661.

    @Expensify/applause please retest this issue on the latest staging build now that the PR has been reverted, and confirm whether it still reproduces.

  9. puneetlath commented on Jul 21, 2026

    @puneetlath
    Contributor

    PR reverted.

  10. m-natarajan commented on Jul 21, 2026

    @m-natarajan

    issue not reproduce using build v9.4.41-4.
    new manual expense flow not displayed.
    mac/chrome

    Screen.Recording.2026-07-22.at.6.31.31.AM.mov
  11. thelullabyy commented on Jul 29, 2026

    @thelullabyy
    Contributor

    @MelvinBot Please investigate and give me patch file to test your fix solution

  12. MelvinBot commented on Jul 29, 2026

    @MelvinBot
    Contributor

    Patch to test the fix

    Root cause: The Split confirmation screen surfaces common.error.invalidAmount twice — once inline on the editable amount input in AmountField.tsx:110-114, and again in the footer FormHelpMessage. The footer copy leaks through because the split branch in useFormErrorManagement.ts:241-243 returns early — before the inline-suppression guards that the non-split path uses at lines 252-262 run. The fix lets the split branch suppress the same inline-surfaced errors.

    Save the block below as split-invalid-amount-fix.patch at the repo root and apply with git apply split-invalid-amount-fix.patch:

    diff --git a/src/components/MoneyRequestConfirmationList/hooks/useFormErrorManagement.ts b/src/components/MoneyRequestConfirmationList/hooks/useFormErrorManagement.ts
    index fc87e43..1c8cca1 100644
    --- a/src/components/MoneyRequestConfirmationList/hooks/useFormErrorManagement.ts
    +++ b/src/components/MoneyRequestConfirmationList/hooks/useFormErrorManagement.ts
    @@ -239,6 +239,16 @@ function useFormErrorManagement({
                 return routeError;
             }
             if (isTypeSplit && !shouldShowReadOnlySplits) {
    +            // In the new manual expense flow the amount/merchant fields surface these required/invalid errors inline, so
    +            // don't repeat them at the bottom of the form (which would show the same error twice).
    +            if (isNewManualExpenseFlowEnabled && (formError === 'common.error.fieldRequired' || formError === 'iou.error.invalidMerchant')) {
    +                return undefined;
    +            }
    +            // `common.error.invalidAmount` is surfaced inline on the editable amount input. Distance requests disable that
    +            // input, so keep the distance-amount error in the footer — otherwise an invalid distance expense fails silently.
    +            if (isNewManualExpenseFlowEnabled && !isDistanceRequest && formError === 'common.error.invalidAmount') {
    +                return undefined;
    +            }
                 return debouncedFormError ? translate(debouncedFormError) : undefined;
             }
             // Don't show error at the bottom of the form for missing attendees — the field surfaces it inline.

    Testing: + > Split expense > Manual > Split (with an empty/invalid amount). Only the inline "Invalid amount" error under the amount input should show — the duplicate footer copy is gone.

    Notes
    • Applies cleanly against main @ cabd5f9.
    • This only changes the new-manual-flow (isNewManualExpenseFlowEnabled) case; the distance-request guard keeps that error in the footer since distance disables the inline input.
    • The offending flow was gated by reverting feat: remove isNewManualExpenseFlowEnabled beta flag #96228, so to reproduce/verify you may need the new manual expense flow enabled. This fix is what should ship alongside re-landing that PR so the regression doesn't return.
  13. added and removed
    ReviewingHas a PR in review
    on Sep 9, 2026
  14. melvin-bot commented on Sep 9, 2026

    @melvin-bot

    @puneetlath

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.74-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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

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