Skip to content

Expense - IOU sender can pay the expense and error shows up #95535

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.29-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: #92787
Email or phone of affected tester (no customers): jsnoidjosddijsojidsoj@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 with any user.
  3. Submit an expense to the user.
  4. Click Mark as paid.

Expected Result:

IOU sender should not be able to pay the expense.

Actual Result:

IOU sender can pay the expense and error shows up.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

To be added by Applause Leads

View all open jobs on GitHub

Bug7202172_1783450037412.3.mp4

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7202172

Issue OwnerCurrent Issue Owner: @dmkt9

Activity

  1. added
    DeployBlockerCash
    Bug
    on Jul 7, 2026
  2. applause-bot commented on Jul 7, 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/60ecf1fa3b9ac2de87b135a3020d9642821e6feb4d1f2516cfd1471117ee10b1

  3. melvin-bot commented on Jul 7, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jul 7, 2026

    @melvin-bot

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

  5. github-actions commented on Jul 7, 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. deleted a comment from on Jul 7, 2026
  7. deleted a comment from melvin-bot on Jul 7, 2026
  8. mjasikowski commented on Jul 7, 2026

    @mjasikowski
    Contributor

    @NikkiWines this comes from #92787

  9. MelvinBot commented on Jul 7, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    ⚠️ Note on the uploaded fix_iou_state.zip: it was posted by a brand-new account with no contributor history and social-engineering-style wording. Please do not download or run it — patches should come as a PR that can be reviewed in the open, not an executable zip.

    TL;DR: Based on code analysis, linked PR #92787 does not change the pay-button logic for a plain 1:1 DM IOU, so a straight revert likely won't fix this. The repro (a DM) also doesn't match that PR's feature (workspace preferred payer). This needs a quick runtime check of the actual report before picking a resolution.

    What the PR changed (and why it's inert for a DM IOU): PR #92787 broadened the pay gate so a non-payer admin can pay in a manual-reimbursement workspace. Every new clause is guarded by policy?.reimbursementChoice === MANUAL && isPolicyAdmin(policy):

    A 1:1 DM IOU has no real policy, so reimbursementChoice is undefined and isPolicyAdmin(undefined) is false → each clause collapses back to the pre-PR isReportPayer. And isPayer for a DM IOU falls through to the unchanged line ReportUtils.ts:2887: return isAdmin || (isMoneyRequestReport(iouReport) && isManager);. For the submitter of a request, isAdmin is false and isManager is false (the submitter is ownerAccountID; the recipient is managerID), so the Pay action should not appear — same as before the PR.

    Two candidate root causes — please verify which:

    1. If the repro is truly a bare DM (no workspace): PR [Payment due @dmkt9] Allow manual reimbursement workspaces to set and use a preferred payer #92787 is likely not the cause — the report may be mislinked, or the real trigger is a mis-set managerID (the only way isPayer returns true for the submitter is managerID === current user). Check the actual iouReport.managerID vs ownerAccountID vs the current account in Onyx.
    2. If a manual-reimbursement workspace is involved: the PR intentionally lets any policy admin (not just the designated payer) see Pay. If the backend still rejects non-designated payers, that produces exactly "Pay button shows → error." That would make the PR the cause and point the fix at the canNonPayerAdminPay broadening above.
    Investigation details & evidence

    Analyzed against main @ 74caf6328d8e8913d7f66928273fa6484dea4ab1.


    Next Steps for Contributor+ team:

    • Confirm whether the repro report is a bare DM IOU or tied to a manual-reimbursement workspace (check managerID, ownerAccountID, and policy.reimbursementChoice). That decides between candidate 1 (mislinked / managerID bug) and candidate 2 (PR [Payment due @dmkt9] Allow manual reimbursement workspaces to set and use a preferred payer #92787's non-payer-admin broadening).
    • Reply @MelvinBot <feedback> (e.g. paste the report's managerID/owner/policy) to refine, or @MelvinBot implement this once the correct root cause is confirmed.
  10. NikkiWines commented on Jul 7, 2026

    @NikkiWines
    Contributor

    I'm not able to reproduce this on staging:

    IOU Sender: Cannot pay, this matches expected result: IOU sender should not be able to pay the expense. ✅

    Screen.Recording.2026-07-07.at.22.40.51.mov

    IOU Recipient: Can pay without error ✅
    https://github.com/user-attachments/assets/35a16968-cb23-4d0e-a25e-5cb9d40bb667

    @lanitochka17 can you confirm if there are any other steps that need to be taken to reproduce this?

  11. lanitochka17 commented on Jul 8, 2026

    @lanitochka17

    @NikkiWines Issue is not repro now

    Screen.Recording.2026-07-08.at.22.27.21.mov
  12. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Jul 8, 2026
  13. grgia commented on Jul 8, 2026

    @grgia
    Contributor

    Removing blocker label, will leave open

  14. NikkiWines commented on Jul 8, 2026

    @NikkiWines
    Contributor

    I think we can close this if the issue is not reproducible! @grgia feel free to reopen if you disagree!

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

Metadata

Metadata

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions