Skip to content

[$250] Rejected and Held Expenses Not Handled Correctly During Approval Flow #88355

Closed

Description

@m-natarajan

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.60-18
Reproducible in staging?: Needs Reproduction (Requires Chrome PWA)
Reproducible in production?: Needs reproduction
If this was caught during regression testing, add the test name, ID and link from BrowserStack:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @rafecolton
Slack conversation (hyperlinked to channel name): #Expensify Product

Action Performed:

  1. Create a report with: Valid receipts and Receipts with violations
  2. Attempt to reject the expenses with violations
  3. Observe behavior
  4. Put the violating expenses on hold
  5. Click Approve on the report

Expected Result:

Rejected expenses:
Should be removed from the report or clearly marked as rejected
Held expenses Should:
Trigger a prompt to approve only unheld expenses
Be excluded from approval
Be moved to a separate report or remain pending

Actual Result:

Rejected expenses: Remain on the report
No visual indicator of rejection
No error or feedback
Held expenses: Show hold violation indicator
But are still approved when approving the report

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

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

Screenshots/Videos

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @sobitneupane
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022046326401067371473
  • Upwork Job ID: 2046326401067371473
  • Last Price Increase: 2026-05-25

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 20, 2026
  2. MelvinBot commented on Apr 20, 2026

    @MelvinBot
    Contributor

    This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

  3. MelvinBot commented on Apr 20, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    ⚠️ Preliminary analysis (medium confidence) — the code appears to already handle both scenarios described, so this may be an edge case, a backend issue, or needs clearer reproduction steps.

    Finding: The App codebase already implements both (1) a held-expense approval modal that lets approvers choose partial vs full approval, and (2) individual expense rejection that removes expenses from reports and adds a visual violation indicator. The symptoms described may stem from an edge case where these flows don't trigger correctly, or from confusion about the two different rejection flows (individual vs report-level).

    Recommended next step: This issue needs clear reproduction steps to determine whether the code paths are failing or whether the reporter encountered a different flow than expected.

    Investigation details

    Held Expense Approval Flow

    The approval flow at useConfirmApproval.ts:34-61 checks isAnyTransactionOnHold and opens a hold menu modal (ProcessMoneyReportHoldMenu.tsx:78-94) with two options:

    • "Approve only $X" → partial approval (full=false), held expenses split into a new report via Hold.ts:656-962
    • "Approve $Y" → full approval (full=true), clears all holds

    This is handled in ReportWorkflow.ts:325-691. The full parameter controls whether held transactions are included or split out.

    Rejection Flow

    Individual expense rejection in RejectMoneyRequest.ts:196-701 does remove expenses from reports (adjusting totals or deleting single-expense reports) and does add an AUTO_REPORTED_REJECTED_EXPENSE violation with showInReview: true.

    However, the separate report-level rejection (rejectExpenseReport at line 961) changes report state without removing individual expenses — the reporter may have encountered this flow instead.

    Why the reported behavior might still occur

    1. The hasNonHeldExpenses check could be computed incorrectly for certain expense configurations (e.g., mixed violation types), preventing the modal from appearing
    2. The Chrome PWA platform (noted in the issue) could have a rendering issue with the modal
    3. The backend may not be properly honoring full=false in some configurations

    Possibly Related Issues


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

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 20, 2026
  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 20, 2026
  6. melvin-bot commented on Apr 20, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

  7. changed the title [-]Rejected and Held Expenses Not Handled Correctly During Approval Flow[/-] [+][$250] Rejected and Held Expenses Not Handled Correctly During Approval Flow[/+] on Apr 20, 2026
  8. melvin-bot commented on Apr 20, 2026

    @melvin-bot
  9. JasimMalook commented on Apr 20, 2026

    @JasimMalook

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

    During the approval flow, expenses that are rejected or put on hold are not handled correctly:

    Rejected expenses remain in the report without any clear visual indication
    Held expenses still get approved when approving the full report
    No clear feedback or prompt is shown to the user

    This creates confusion and incorrect financial actions during approval.

    What is the root cause of that problem?

    The issue appears to be caused by inconsistent filtering and state handling in the approval flow:

    Rejected expenses
    The rejection action updates the expense state
    But the report-level UI and approval logic still include these expenses
    There is no consistent filtering or visual indicator applied after rejection
    Held expenses
    Held state (violation) is shown in UI
    But the approval action does not exclude held expenses when approving the report
    This suggests that the approval logic is not validating expense-level states before processing
    Desync between UI and action logic
    UI correctly shows violations (held)
    But approval logic processes all transactions without checking:
    isHeld
    isRejected

    👉 So root problem:
    Approval flow is not respecting expense-level states (held/rejected) when performing report-level approval

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

    We should enforce state-aware approval logic + UI consistency:

    ✅ 1. Exclude held & rejected expenses during approval

    In approval action (likely in ReportActions or approval handler):

    const approvableTransactions = reportTransactions.filter(
    (transaction) =>
    !isHeld(transaction) &&
    !isRejected(transaction)
    );

    Only approve approvableTransactions.

    ✅ 2. Trigger confirmation modal when held expenses exist

    Before approving:

    If held expenses exist → show modal:

    “This report contains held expenses. Do you want to approve only valid expenses?”

    This aligns with expected behavior mentioned in issue.

    ✅ 3. Ensure rejected expenses are handled in UI
    Either:
    Remove them from the report view
    OR clearly mark them as Rejected with a badge/state

    Example:

    {isRejected && }
    ✅ 4. Keep report state consistent
    Report totals should exclude:
    Rejected expenses
    Held expenses (until resolved)
    Why this approach?
    Fixes both logic + UI inconsistency
    Prevents incorrect approvals
    Aligns behavior with expected approval flow
    Handles edge cases (partial approvals, violations)
    What alternative solutions did you explore? (Optional)
    Only fixing UI → rejected because logic would still approve invalid expenses
    Only fixing approval logic → rejected because UX confusion remains
    Backend-only fix → avoided since issue shows clear FE inconsistency

    📌 Contributor Details
    Email: jasimmalook@gmail.com
    Upwork: https://www.upwork.com/freelancers/~014c25762fc2275193

  10. github-actions commented on Apr 20, 2026

    @github-actions
    Contributor

    ⚠️ @JasimMalook Thanks for your proposal. Please update it to follow the proposal template, as proposals are only reviewed if they follow that format (note the mandatory sections).

  11. JasimMalook commented on Apr 20, 2026

    @JasimMalook

    🚫 Duplicated proposal withdrawn by 🤖 ProposalPolice.

  12. github-actions commented on Apr 20, 2026

    @github-actions
    Contributor

    ⚠️ @JasimMalook Your proposal is a duplicate of an already existing proposal and has been automatically withdrawn to prevent spam. Please review the existing proposals before submitting a new one.

  13. 22 remaining items

  14. mvtglobally commented on May 16, 2026

    @mvtglobally

    Issue not reproducible during KI retests. (Second week)

  15. melvin-bot commented on May 18, 2026

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  16. sobitneupane commented on May 18, 2026

    @sobitneupane
    Contributor

    @rafecolton It looks like the issue is no longer reproducible. Are you still able to reproduce it?

  17. melvin-bot commented on May 18, 2026

    @melvin-bot

    @sobitneupane this issue is now 4 weeks old, please consider:

    • Finding a contributor to fix the bug
    • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
    • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

    Thanks!

  18. melvin-bot commented on May 21, 2026

    @melvin-bot

    @sobitneupane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  19. mvtglobally commented on May 23, 2026

    @mvtglobally

    Issue not reproducible during KI retests. (Third week)

  20. melvin-bot commented on May 25, 2026

    @melvin-bot

    📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

  21. melvin-bot commented on May 25, 2026

    @melvin-bot

    @sobitneupane Still overdue 6 days?! Let's take care of this!

  22. sobitneupane commented on May 27, 2026

    @sobitneupane
    Contributor

    Since the issue is no longer reproducible, we can close it.

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.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsNeeds ReproductionReproducible steps needed

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions