Skip to content

[Due for payment 2026-07-16] Expense - Pay button is not shown for payments admin when payments admin is the payer #95561

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): jsdionjsodjiosdjosjojdis2@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:

Precondition:

  • Create a Control workspace.
  • Invite user as payments admin to the workspace.
  • Change Payer to payments admin in workspace settings > Workflows > Payer.
  1. Go to staging.new.expensify.com
  2. [Payments admin] Create an expense in workspace chat.
  3. [Payments admin] Click Submit.
  4. [Owner] Approve payments admin's report.
  5. [Payments admin] Open the report.

Expected Result:

Pay button should appear for payments admin when payments admin is the payer.

Actual Result:

Pay button is not shown for payments admin when payments admin is the payer.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7202551_1783493817632.5.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7202551

Issue OwnerCurrent Issue Owner: @dmkt9

Activity

  1. added
    DeployBlockerCash
    on Jul 8, 2026
  2. added
    Bug
    on Jul 8, 2026
  3. applause-bot commented on Jul 8, 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/29f3f3daf18c495b47b9662d3fb7d9f74886ad7f28a4bfcdd6d27b396df1c3fe

  4. melvin-bot commented on Jul 8, 2026

    @melvin-bot

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

  5. melvin-bot commented on Jul 8, 2026

    @melvin-bot

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

  6. github-actions commented on Jul 8, 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.
  7. dmkt9 commented on Jul 8, 2026

    @dmkt9
    Contributor

    @jponikarchuk This is a duplicate of #95537

  8. MelvinBot commented on Jul 8, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Root Cause: A "payments admin" has the policy role paymentsAdmin, which is not admin. Every payer-eligibility path rewritten by PR #92787 gates the manual‑reimbursement case on the full admin role, so a designated payer who is a paymentsAdmin (rather than an owner/admin) fails every check and the Pay button is hidden.

    Introduced by #92787 ("Allow manual reimbursement workspaces to set and use a preferred payer"). Confidence: high (code evidence).

    Recommended Fix: In the manual-reimbursement branches, treat the current user as an eligible payer when they are the designated payer, without requiring the admin role — and read the persisted payer from policy.reimburser (what setWorkspacePayer writes), not only policy.achAccount?.reimburser. Concretely:

    Given this is a deploy blocker, reverting #92787 is a safe fallback if a targeted fix can't be verified quickly.

    Investigation details & evidence

    Repro: Control workspace → invite user as a payments admin → set them as Payer in Workflows → they submit an expense → owner approves → payments admin opens the report → no Pay button. Workspace has no bank account (reimbursementChoice = REIMBURSEMENT_MANUAL).

    Why it fails, step by step:

    1. paymentsAdmin is a distinct role from admin (CONST.POLICY.ROLE.PAYMENTS_ADMIN = 'paymentsAdmin'). In isPayer, isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN is therefore false for a payments admin.
    2. Manual branch returns isReimburser, and isReimburser requires && isAdmin → false even when the user is the designated reimburser.
    3. The caller fallbacks (... || (MANUAL && isPolicyAdmin(policy))) also return false because isPolicyAdmin is false for a paymentsAdmin. So getReportPrimaryAction never returns PAY and the report‑preview/badge Pay actions are hidden too.

    Regression: Before #92787, the manual branch was simply return isAdmin (any admin could pay). After #92787 it became "only the designated reimburser, who must be an admin" — which excludes a paymentsAdmin payer entirely.

    Secondary risk: all reads use policy.achAccount?.reimburser ?? policy.owner and ignore top‑level policy.reimburser. If the backend doesn't persist achAccount.reimburser without a connected bank account, reimburserEmail silently falls back to policy.owner, so even an admin designated payer who isn't the owner could be missed. Worth confirming with an Onyx snapshot / backend check of what SetWorkspacePayer persists when there's no bank account.

    Test gap: the new tests in tests/unit/ReportUtilsTest.ts and tests/actions/IOUTest/ReportWorkflowTest.ts all set the viewer's role to ADMIN and populate achAccount.reimburser. No test covers a paymentsAdmin designated payer on a no‑bank‑account manual workspace — which is exactly the shipped regression.

    ⚠️ Note for maintainers: the fix_pay_btn.zip attachment posted above by an unrecognized account is unsolicited — please don't download or run it. Vague "here's a quick patch" zip attachments from new accounts are a common malware / social‑engineering vector.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/95561) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  9. deleted a comment from on Jul 8, 2026
  10. deleted a comment from melvin-bot on Jul 8, 2026
  11. 1 remaining item

  12. added
    Reviewing
    on Jul 8, 2026
  13. melvin-bot commented on Jul 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.

  14. grgia commented on Jul 8, 2026

    @grgia
    Contributor
  15. IuliiaHerets commented on Jul 9, 2026

    @IuliiaHerets

    Issue is not reproducible on Windows 11 / Chrome in v9.4.29-3 and on Xiaomi Poco F5 / Android 13 in v9.4.29-3

    bandicam.2026-07-09.15-17-30-935.mp4
    1000210465.mp4
  16. removed
    DeployBlockerCash
    on Jul 9, 2026
  17. added
    Daily
    and removed
    Reviewing
    Hourly
    on Jul 9, 2026
  18. changed the title [-]Expense - Pay button is not shown for payments admin when payments admin is the payer[/-] [+][Due for payment 2026-07-16] Expense - Pay button is not shown for payments admin when payments admin is the payer[/+] on Jul 9, 2026
  19. melvin-bot commented on Jul 9, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  20. melvin-bot commented on Jul 9, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.31-0 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-07-16. 🎊

    For reference, here are some details about the assignees on this issue:

    • @dmkt9 requires payment (Needs manual offer from BZ)
  21. melvin-bot commented on Jul 9, 2026

    @melvin-bot

    @dmkt9 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]

  22. melvin-bot commented on Jul 10, 2026

    @melvin-bot

    @dmkt9 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]

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