Skip to content

[Due for payment 2026-09-16] [$250] Expense - No approval options when expense with 0.00 amount is held #83259

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.25-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: #70825
Email or phone of affected tester (no customers): jsodjsodnjoisjdosij@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:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense with 0.00 amount.
  4. Create another expense with negative amount.
  5. Open the expense report.
  6. Hold the expense with 0.00 amount.
  7. Go back to workspace chat.
  8. Click Submit.
  9. Click Approve button.

Expected Result:

Approve dropdown button will give options to approve pending amount or full amount.

Actual Result:

The expenses are approved without any option.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7086421_1771884483458.2.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @ahmedGaber93
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022026071436582467634
  • Upwork Job ID: 2026071436582467634
  • Last Price Increase: 2026-02-23

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    on Feb 23, 2026
  2. melvin-bot commented on Feb 23, 2026

    @melvin-bot

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

  3. melvin-bot commented on Feb 23, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 23, 2026

    @melvin-bot

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

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

    @MelvinBot
    Contributor

    Proposal

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

    When an expense report contains a $0.00 held expense alongside a negative-amount expense, clicking the Approve button auto-approves the full report without showing any approval options (partial vs full). The expected behavior is a dropdown presenting "Approve only $X" (non-held amount) and "Approve $Y" (full amount) options.

    What is the root cause of that problem?

    PR #70825 introduced ExpenseHeaderApprovalButton, which replaced the old ProcessMoneyReportHoldMenu (DecisionModal) for approval confirmations. The new component builds a dropdown with partial/full options via getApprovalDropdownOptions, but only renders the dropdown when approvalOptions.length > 1. When there's only 1 option, it falls through to a plain Button that calls onApprove(true) (full approval) immediately.

    The issue is in how hasValidNonHeldAmount is computed in getNonHeldAndFullAmount (ReportUtils.ts:10618-10623):

    hasValidNonHeldAmount =
        hasHeldExpensesLocal &&
        (adjustedUnheldTotal >= 0 ||
            (isExpenseReport && abs(adjustedUnheldTotal) > 0
             && abs(adjustedUnheldTotal) !== abs(adjustedTotal)));
    

    When a $0.00 expense is held, holding it does not change unheldTotal (since transactionAmount = 0), so unheldTotal === total. This means Math.abs(adjustedUnheldTotal) === Math.abs(adjustedTotal), causing the fallback condition to fail. If adjustedUnheldTotal is also negative (which it is for expense reports with negative amounts), the first condition (>= 0) also fails. Result: hasValidNonHeldAmount = false.

    With hasValidNonHeldAmount = false, getApprovalDropdownOptions (ExpenseHeaderApprovalButton.tsx:73) skips the partial-approve option, producing only 1 option. The check at line 122 (approvalOptions.length > 1) fails, and the component renders a plain Button that auto-approves without any confirmation.

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

    In ExpenseHeaderApprovalButton.tsx, when shouldShowDropdown is true (held expenses exist) but only 1 approval option is generated (e.g., the $0 held edge case), the component should still show a confirmation UI rather than silently auto-approving. Two approaches:

    1. Show the dropdown even with 1 option when shouldShowDropdown is true: Change the condition at line 122 from approvalOptions.length > 1 to just check shouldShowDropdown, and always use the ButtonWithDropdownMenu (which already has shouldAlwaysShowDropdownMenu=true). This ensures the user sees a confirmation before approving held expenses.

    2. Fix the hasValidNonHeldAmount calculation to handle the case where unheldTotal === total (held amount is $0) by recognizing that there ARE held expenses even when the amounts are identical. This would produce 2 options and the dropdown would render naturally.

    Option 1 is the safer, more minimal fix since it addresses the symptom directly: any time held expenses exist, the user should see a confirmation before approving.

    What alternative solutions did you explore? (Optional)

    • Fixing the !!expenseReport.unheldTotal truthiness check in approveMoneyRequest (IOU/index.ts:10548) — this has the same falsy-zero bug but is a secondary issue since the UI already skips showing options.
    • Restoring the old ProcessMoneyReportHoldMenu flow for approvals — this was intentionally replaced by PR Clarify Approval Options When Held Expenses Exist #70825, so reverting would undo the intended UX improvement.
    Detailed Investigation

    Evidence Chain

    1. Holding a $0 expense doesn't change unheldTotal (Hold.ts:115): transactionAmount = 0 * coefficient = 0, so unheldTotal = total - 0 = total.

    2. hasValidNonHeldAmount evaluates to false (ReportUtils.ts:10618-10623): Since unheldTotal === total, the absolute values are equal, and for expense reports with negative adjustedUnheldTotal, both conditions fail.

    3. Only 1 dropdown option is generated (ExpenseHeaderApprovalButton.tsx:73-81): The partial-approve option requires nonHeldAmount && hasValidNonHeldAmount && !hasOnlyHeldExpenses. With hasValidNonHeldAmount = false, the partial option is skipped.

    4. Dropdown doesn't render (ExpenseHeaderApprovalButton.tsx:122): approvalOptions.length > 1 is false, so ButtonWithDropdownMenu is not used.

    5. Plain Button auto-approves (ExpenseHeaderApprovalButton.tsx:139-147): Falls through to onApprove(true) which calls approveMoneyRequest with full approval.

    Relevant Code

    • src/components/ExpenseHeaderApprovalButton.tsx:59-147 - Core approval button logic with the bug
    • src/libs/ReportUtils.ts:10599-10630 - getNonHeldAndFullAmount with hasValidNonHeldAmount calculation
    • src/libs/actions/IOU/Hold.ts:107-118 - Hold action that doesn't change unheldTotal for $0
    • src/libs/actions/IOU/index.ts:10545-10550 - Secondary !!unheldTotal truthiness bug
    • src/components/MoneyReportHeader.tsx:1019-1025 - onApprove handler that bypasses confirmation

    Implementation Notes

    • The shouldAlwaysShowDropdownMenu prop is already passed to ButtonWithDropdownMenu in the dropdown path, so using it with 1 option should work
    • The secondary actions menu (3-dot menu) has its own approval submenu logic that may also need the same fix
    • The !!expenseReport.unheldTotal check in approveMoneyRequest should be changed to a proper comparison (e.g., expenseReport.unheldTotal !== undefined && expenseReport.unheldTotal !== null) as a separate fix

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  7. 10 remaining items

  8. melvin-bot commented on Feb 24, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  9. marcochavezf commented on Feb 24, 2026

    @marcochavezf
    Contributor
  10. IuliiaHerets commented on Feb 24, 2026

    @IuliiaHerets

    @marcochavezf Windows 10/ Chrome
    v9.3.25-9
    Not Repro

    repro.-.issue.83259.mp4
  11. melvin-bot commented on Feb 26, 2026

    @melvin-bot

    📣 @AbdulSalaamazimi! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  12. nabi-ebrahimi commented on Feb 26, 2026

    @nabi-ebrahimi

    Hi @marcochavezf, I am able to reproduce the issue. Could you please re-open this issue. thanks.

    3.mp4
  13. jponikarchuk commented on Sep 8, 2026

    @jponikarchuk

    Deploy Blocker #100639 was identified to be related to the PR #83667 that attempted to fix this issue.

  14. melvin-bot commented on Sep 8, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  15. added and removed
    ReviewingHas a PR in review
    on Sep 9, 2026
  16. melvin-bot commented on Sep 9, 2026

    @melvin-bot

    @ahmedGaber93

    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:

    If no regressions arise, payment will be issued on 2026-09-16. 🎊

    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]

  17. changed the title [-][$250] Expense - No approval options when expense with 0.00 amount is held[/-] [+][Due for payment 2026-09-16] [$250] Expense - No approval options when expense with 0.00 amount is held[/+] on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions