Skip to content

[Due for payment 2026-06-12] Expense - User appears in participant list when expense amount is negative #90656

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 FAB > Create expense > Manual.
  3. Enter negative amount.
  4. Click To field.
  5. Enter email.
  6. Select the user.
  7. Click Create expense.

Expected Result:

In Step 5, when the amount is negative, user will not appear in participant list when searched with email.

Actual Result:

In Step 5, when the amount is negative, user appears in participant list when searched with email.
In Step 7, negative expense can be submitted and the created expense does not show negative amount.

User can also enter flipped amount when participant is a user when it should not be allowed.

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

Issue OwnerCurrent Issue Owner: @mallenexpensify

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: None

    Recommendation: REVERT

    PR #87920 introduced the new manual expense flow and is the direct cause of both symptoms — negative amounts being accepted for P2P expenses and the submitted expense not displaying the negative amount correctly. Reverting it removes the broken flow until a fix can be made.

    Assigned: @ChavdaSachin (PR author), @ShridharGoel, @puneetlath (approving reviewers)
    Labels: DeployBlockerCash kept (Frontend bug — App PR is the cause). DeployBlocker is not present and not added.

    Detailed Analysis

    Evidence

    Verification

    Affected files:

    All three files changed in PR #87920 directly relate to the reported symptoms.

    Root Cause

    Bug 1 — Negative amount allows P2P participants to appear in search:

    shouldEnableNegative() in src/libs/ReportUtils.ts returns true whenever iouType === CONST.IOU.TYPE.CREATE (isCreatingNewIOU = true). The new manual expense flow introduced by PR #87920 uses iouType === CREATE throughout the flow, including when the ParticipantPicker is opened. The ParticipantSearchResults component's includeP2P flag is not conditioned on the current transaction amount — it is only conditioned on action type, per diem, time request, and corporate card flags. As a result, when a negative amount is entered before opening the participant picker, P2P users are still shown in search results even though negative amounts are not valid for P2P expenses.

    Bug 2 — Created expense does not show negative amount:

    The AmountField in the new flow uses transaction?.isAmountSet to determine whether to show the real value vs. an empty field. The sign/flip logic for negative amounts introduced in the new AmountField section (using allowNegative from shouldEnableNegative) may not be correctly persisting the signed value to transaction.amount, causing the created expense to display an incorrect (non-negative) amount.

    Both bugs are in App code introduced exclusively by PR #87920. No backend changes are involved.

  6. MelvinBot commented on May 14, 2026

    @MelvinBot
    Contributor

    Proposal

    Problem

    The new manual expense flow (behind newManualExpenseFlow beta, introduced in #87920) completely bypasses the negative-amount participant filtering. In the old flow, entering a negative amount restricted participant selection to workspaces only. In the new flow, individual users are always shown regardless of the amount sign, and negative expenses can be submitted (though they display as positive due to Math.abs at render time).

    Solution

    There are two independent gaps that need fixing:

    Gap 1 — ParticipantPicker has no isWorkspacesOnly prop. The new flow opens participants via ParticipantPicker, which never passes isWorkspacesOnly to MoneyRequestParticipantsSelector. When isWorkspacesOnly is falsy, individual users and contacts are always shown.

    Gap 2 — IOURequestStepConfirmation never computes isWorkspacesOnly. The confirmation screen renders ParticipantPicker without any amount-based filtering. Even if ParticipantPicker accepted the prop, no caller passes it.

    The fix:

    1. Add an isWorkspacesOnly prop to ParticipantPicker and forward it to MoneyRequestParticipantsSelector.
    2. In IOURequestStepConfirmation, compute isWorkspacesOnly from the current transaction draft amount (i.e., transaction?.amount <= 0) and pass it to ParticipantPicker.

    This mirrors the logic already present in the old flow at IOURequestStepParticipants.tsx:136:

    return initialTransaction?.amount !== undefined && initialTransaction?.amount !== null && initialTransaction?.amount <= 0;
    
    Investigation details

    Root cause trace:

    1. The new flow renders IOURequestStepConfirmation directly from IOURequestStartPage.tsx:251, skipping IOURequestStepParticipants entirely.
    2. IOURequestStepParticipants.getIsWorkspacesOnly has an early return of false when the new flow beta is enabled — so even if the old page were reached, it would skip the negative check.
    3. ParticipantSearchResults correctly gates individual participants behind isWorkspacesOnly, but this prop is never set to true in the new flow.

    Why the created expense doesn't show negative amount:

    TransactionUtils.getAmount() applies Math.abs() by default for non-expense-report contexts. The negative value is stored correctly but stripped at display time. Additionally, useConfirmationValidation.ts:163 only checks iouAmount === 0 for P2P — it does not block negative amounts.


    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

    NAB: only happens in the beta accounts

  8. puneetlath commented on May 14, 2026

    @puneetlath
    Contributor

    Demoting.

  9. 25 remaining items

  10. melvin-bot commented on Jun 11, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. melvin-bot commented on Jun 11, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  12. ChavdaSachin commented on Jun 11, 2026

    @ChavdaSachin
    Contributor

    Not here, paid via project

  13. mallenexpensify commented on Jun 15, 2026

    @mallenexpensify
    Contributor

    @dukenv0307 @ShridharGoel either of you due payment here? Thx

  14. ShridharGoel commented on Jun 15, 2026

    @ShridharGoel
    Contributor

    Not me

  15. dukenv0307 commented on Jun 16, 2026

    @dukenv0307
    Contributor

    @mallenexpensify I'll be paid here

  16. mallenexpensify commented on Jun 16, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @dukenv0307 due $250 via NewDot

  17. quinthar commented on Jun 29, 2026

    @quinthar
    Contributor

    Approved $250 to @dukenv0307

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions