Skip to content

[$175] [Exploratory] LHN - "Pay" badge is not visible on member´s side, despite being able to pay the expense. #100355

Open

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.70-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from BrowserStack:
Email or phone of affected tester (no customers): ibellicotest+2766@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: Left Hand Navigation (LHN)

Action Performed:

Prerequisite: User A is owner of a workspace and invited User B as "Workspace Admin"
Prerequisite 2: Delayed submissions, approvals an payments enabled.

  1. Open the staging.new.expensify.com website.
  2. As User B (Workspace Admin) navigate to workspace chat and create a manual expense.
  3. Note that "Submit" action is available on expense preview and visible as badge on LHN.
  4. Click on "Submit" on expense preview.
  5. As User A (Workspace Owner), approve the expense created by User B.
  6. As User B, note that "Pay" option appears on expense preview.
  7. As User B, note that "Pay" badge is not visible on LHN.

Expected Result:

"Pay" badge should be visible on LHN for expenses pending payment, on every worksapce admin side.

Actual Result:

"Pay" badge is not visible on LHN for expenses pending payment, on member with "Workspace Admin" status side.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7250480_1788463513068.Member_Pay.mp4

View all open jobs on GitHub

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

Upwork Automation - Do Not Edit

Activity

  1. applause-bot commented on Sep 3, 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/6a3985fad84a0fe0dfd525b03138877a9b79fcabedc22e1ac7477123b592fc3b

  2. aimane-chnaif commented on Sep 23, 2026

    @aimane-chnaif
    Contributor

    @MelvinBot investigate this

  3. MelvinBot commented on Sep 23, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    This is working as designed, not a bug. The Pay button is intentionally available to any workspace admin, while the Pay badge/GBR in the LHN is intentionally reserved for the workspace's designated payer. That split is written into the spec for [CFI] [$500] Allow any workspace admin to pay reports:

    We should not actively prompt admins that aren't the workspace payer to pay via badges/GBRs. That stays as-is.

    In this repro User A (owner) is the default payer under manual reimbursement, so User B gets the button but deliberately gets no badge.

    Recommendation: close as expected behavior. If we want the badge to follow the button, that's a product decision on [CFI] [$500] Allow any workspace admin to pay reports, not a code defect to fix here.

    Investigation details

    The two rules

    The button path allows a non-payer admin explicitly — src/libs/actions/IOU/ReportWorkflow.ts:248-255 in canIOUBePaid:

    const canPay =
        isReportPayer ||
        (isGroupPolicy(policy) &&
            getReimbursementChoice(policy) === CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL &&
            canMemberWrite(policy, currentUserLogin, CONST.POLICY.POLICY_FEATURE.WORKFLOWS_PAYMENTS));

    The LHN badge path re-gates on isPayer before that admin path can apply — src/libs/actions/IOU/ReportWorkflow.ts:347-350 in getBadgeFromIOUReport. isPayer defaults the manual-mode reimburser to policy.owner (src/libs/ReportUtils.ts:2963) and then returns isReimburser only (src/libs/ReportUtils.ts:2983) — so User B is false. The same gate is on the client-side hasOutstandingChildRequest at src/libs/ReportUtils.ts:3191-3192, which is why there's no green dot either.

    It's deliberate, and it's tested

    Both behaviors are asserted in the same test file:

    Both the admin pay path and the badge suppression landed in the same commit in [Payment due @dmkt9] Allow manual reimbursement workspaces to set and use a preferred payer, whose commit message reads "allow non-payer admins to pay report, but don't show other payment ui elements".

    Why the repro produces no badge

    The setup must be manual reimbursement with the owner as default payer. With reimbursement set to "pay elsewhere" instead, isPayer(..., onlyShowPayElsewhere=true) returns isAdmin (src/libs/ReportUtils.ts:2951-2953) and User B would see the badge. So the badge is payer-scoped, not admin-scoped, exactly as specced.

    Alternatives ruled out

    • Not the broad "any admin can pay" change — [CP staging] Revert "Allow any workspace admin to pay reports" reverted that on the same day this was filed, and it never touched the badge gate.
    • Not RBR-wins, all-expenses-held, non-reimbursable-only, or all-pending — each can independently suppress a badge, but none apply to a plain approved reimbursable expense.
    • Not stale bankAccountList — that only matters for REIMBURSEMENT_YES workspaces.

    Secondary inconsistency worth a separate look

    isPrimaryPayAction is called without canNonPayerAdminPay in two places, which is inconsistent with the two callers that pass true:

    Verification note

    I could not verify this in a browser — web bring-up failed in this run. The conclusion rests on static analysis, the committed unit tests, and the written spec.


    Next Steps for Contributor+ team:
    To accept: No code change is recommended — close as expected behavior, or reopen the discussion on [CFI] [$500] Allow any workspace admin to pay reports if the badge should follow the button.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's analysis.


    view run

  4. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 22, 2026
  5. MelvinBot commented on Oct 23, 2026

    @MelvinBot
    Contributor

    Proposal

    ⚠️ Product sign-off needed first. The spec on [CFI] [$500] Allow any workspace admin to pay reports still says: "We should not actively prompt admins that aren't the workspace payer to pay via badges/GBRs." This proposal changes that rule. Please confirm the badge should follow the Pay button before you hire anyone.

    What is the root cause of that problem?

    The Pay button and the Pay badge use different permission checks.

    On a manual-reimbursement workspace, isPayer falls back to policy.owner as the payer (src/libs/ReportUtils.ts:3089) and returns true only for that person (src/libs/ReportUtils.ts:3108-3109). User B is an admin but not the owner, so the button shows and the badge does not.

    The same isPayer gate is in hasOutstandingChildRequest (src/libs/ReportUtils.ts:3645), so the optimistic LHN indicator also skips User B.

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

    Make the badge use the same permission rule as the button.

    1. In getBadgeFromIOUReport, let the PAY badge show when the user is the payer or canAdminPayReport(policy, currentUserLogin) is true. Apply this to both the regular pay check and the pay-elsewhere check.
    2. Apply the same change to the pay check in hasOutstandingChildRequest, so the optimistic indicator matches the badge.
    3. Leave isPayer unchanged. Other code relies on it to mean "the designated payer".
    4. Update the test that asserts the old behavior, "should not return PAY badge for non-reimburser admin in manual mode with designated payer" (tests/actions/IOUTest/ReportWorkflowTest.ts:6620). It should expect PAY. Add a test showing an admin without payment permissions still gets no badge.

    canAdminPayReport already limits this to group workspaces with reimbursement turned on, where the user can manage payments (src/libs/PolicyUtils/payments.ts:83-89). The badge would not appear anywhere the button doesn't.

    What alternative solutions did you explore? (Optional)

    Notes
    • The server may also set hasOutstandingChildRequest on the workspace chat. If the green dot still doesn't show for User B after this change, the backend needs the same rule. That fix is outside the App repo.
    • I checked this against current main with static analysis only. I did not reproduce it in a browser.

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


    view run

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 23, 2026
  7. melvin-bot commented on Oct 23, 2026

    @melvin-bot

    Current assignee @aimane-chnaif is eligible for the External assigner, not assigning anyone new.

  8. changed the title [-][Exploratory] LHN - "Pay" badge is not visible on member´s side, despite being able to pay the expense.[/-] [+][$175] [Exploratory] LHN - "Pay" badge is not visible on member´s side, despite being able to pay the expense.[/+] on Oct 23, 2026
  9. melvin-bot commented on Oct 23, 2026

    @melvin-bot
  10. 2 remaining items

  11. melvin-bot commented on Oct 28, 2026

    @melvin-bot

    @aimane-chnaif Eep! 4 days overdue now. Issues have feelings too...

  12. melvin-bot commented on Oct 30, 2026

    @melvin-bot

    @aimane-chnaif 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  13. melvin-bot commented on Nov 3, 2026

    @melvin-bot

    @aimane-chnaif 10 days overdue. I'm getting more depressed than Marvin.

  14. melvin-bot commented on Nov 3, 2026

    @melvin-bot

    @aimane-chnaif 10 days overdue. Is anyone even seeing these? Hello?

  15. melvin-bot commented on Nov 3, 2026

    @melvin-bot

    @aimane-chnaif 10 days overdue. Is anyone even seeing these? Hello?

  16. melvin-bot commented on Nov 3, 2026

    @melvin-bot

    @aimane-chnaif 10 days overdue. Is anyone even seeing these? Hello?

  17. melvin-bot commented on Nov 5, 2026

    @melvin-bot

    @aimane-chnaif 12 days overdue. Walking. Toward. The. Light...

  18. melvin-bot commented on Nov 5, 2026

    @melvin-bot

    @aimane-chnaif 12 days overdue now... This issue's end is nigh!

  19. melvin-bot commented on Nov 5, 2026

    @melvin-bot

    @aimane-chnaif 12 days overdue now... This issue's end is nigh!

  20. jeffrey-graham commented on Nov 7, 2026

    @jeffrey-graham
  21. melvin-bot commented on Nov 7, 2026

    @melvin-bot
  22. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    This issue has not been updated in over 14 days. @aimane-chnaif eroding to Weekly issue.

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.ExternalAdded to denote the issue can be worked on by a contributorNot a priorityWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions