Skip to content

Report -"Waiting for and admin to pay expenses" on approved expense changes when reopening it #81967

Closed

Description

@nlemma

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.16.0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #81403
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has at least one workspace.
Prerequisite 2: Delayed submissions set to manual and approvals enabled.

  1. Open the staging.new.expensify.com website,
  2. Open any workspace chat.
  3. Create a manual expense.
  4. Open the just created expense.
  5. Submit and approve the expense.
  6. Note that next step changes to "Waiting for an admin to pay expenses"
  7. Close and reopen report.
  8. Note that next step now changes to "Waiting for you to pay expenses"

Expected Result:

After an expense is submitted and approved, next steps should display a "Waiting for you to pay expenses" message.

Actual Result:

After an expense is submitted and approved, next step shows a "Waiting for an admin to pay expenses" message, that changes to "Waiting for you to pay expenses" after report is closed and reopened.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7073446_1770721168902.Admin.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Feb 10, 2026
  2. melvin-bot commented on Feb 10, 2026

    @melvin-bot

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

  3. melvin-bot commented on Feb 10, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 10, 2026

    @melvin-bot

    Triggered auto assignment to @stephanieelliott (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 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.
  6. OSBotify commented on Feb 10, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Needs Investigation - Likely Frontend bug
    Suspected PR: #81403 - "fix: 81349 Mark as paid via bulk" by @MrMuzyk (Low-Medium confidence)
    Related Issues: N/A

    Recommendation: NEEDS INVESTIGATION

    This issue requires further investigation to identify the root cause. While PR #81403 was flagged by melvin-bot and touches payment-related code, the connection to the "next step" message bug is not immediately clear.

    Why this recommendation:

    • The bug involves incorrect "next step" messaging after approval (shows "Waiting for an admin to pay" instead of "Waiting for you to pay")
    • The message corrects itself upon reopening the report, suggesting the backend data is correct but the optimistic frontend update is wrong
    • PR fix: 81349 Mark as paid via bulk #81403 modified PaymentUtils.getActivePaymentType() which is used in payment flows, but does not directly affect next step calculation
    • No other PRs in the staging deploy checklist appear to modify NextStepUtils, buildOptimisticNextStep, or related approval logic

    Action items:

    • @MrMuzyk (PR fix: 81349 Mark as paid via bulk #81403 author) - Please review if your changes to getActivePaymentType could indirectly affect how next steps are calculated after approval
    • Engineering team should investigate buildOptimisticNextStep in /home/runner/_work/App/App/src/libs/NextStepUtils.ts and the approval flow in approveMoneyRequest
    • This could potentially be a backend bug since the next step is correctly set by the server but incorrectly set optimistically by the client

    Labels: Keeping both DeployBlockerCash and DeployBlocker labels until root cause is confirmed

    Detailed Analysis

    Evidence

    The issue occurs when:

    1. User creates a manual expense in a workspace chat
    2. User submits AND approves the expense (meaning they are the admin/approver)
    3. Next step incorrectly shows "Waiting for an admin to pay expenses"
    4. After closing and reopening the report, it correctly shows "Waiting for you to pay expenses"

    This pattern suggests:

    • The backend correctly calculates the next step (since reopening fetches fresh data and shows the right message)
    • The frontend optimistic update in approveMoneyRequest incorrectly calculates the next step
    • The bug is in buildOptimisticNextStep or the parameters passed to it

    Verification

    I verified that:

    • PR fix: 81349 Mark as paid via bulk #81403 modifies src/libs/PaymentUtils.ts, src/components/SettlementButton/index.tsx, and src/libs/actions/Search.ts
    • These files do not directly calculate next steps
    • The approveMoneyRequest function in /home/runner/_work/App/App/src/libs/actions/IOU/index.ts calls buildOptimisticNextStep (line 10181-10189)
    • No recent PRs in the staging deploy modified NextStepUtils or the approval workflow logic (except PR Add diagnostic logging to approval workflow resolution #81725 which only added logging)

    Root Cause

    Uncertain - The root cause is not definitively identified. Possible explanations:

    1. PR fix: 81349 Mark as paid via bulk #81403 has an indirect side effect on next step calculation (low probability)
    2. Another PR in the staging deploy affects this but was missed in analysis
    3. This is a backend bug that manifests through incorrect API responses in staging
    4. The bug was introduced earlier but only recently detected
  7. MrMuzyk commented on Feb 10, 2026

    @MrMuzyk
    Contributor

    Looking at it

  8. MrMuzyk commented on Feb 10, 2026

    @MrMuzyk
    Contributor

    Im almost certain that it wasn't introduced by my PR but I haven't found the true culprit yet

  9. MrMuzyk commented on Feb 10, 2026

    @MrMuzyk
    Contributor

    I believe that this is the culprit PR that caused this bug

  10. aimane-chnaif commented on Feb 10, 2026

    @aimane-chnaif
    Contributor

    @MobileMage please check this

  11. MobileMage commented on Feb 10, 2026

    @MobileMage
    Contributor

    Yeah, this is me, fixing.

  12. added
    Reviewing
    on Feb 10, 2026
  13. added 2 commits that reference this issue on Feb 10, 2026
    8f77bd0
  14. srikarparsi commented on Feb 10, 2026

    @srikarparsi
    Contributor

    This has been fixed by this revert

    Image
  15. removed
    DeployBlockerCash
    on Feb 11, 2026
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