You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$175] [Exploratory] LHN - "Pay" badge is not visible on member´s side, despite being able to pay the expense. #100355
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.
Open the staging.new.expensify.com website.
As User B (Workspace Admin) navigate to workspace chat and create a manual expense.
Note that "Submit" action is available on expense preview and visible as badge on LHN.
Click on "Submit" on expense preview.
As User A (Workspace Owner), approve the expense created by User B.
As User B, note that "Pay" option appears on expense preview.
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.
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.
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.
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 withoutcanNonPayerAdminPay in two places, which is inconsistent with the two callers that pass true:
src/libs/TodosUtils.ts:152-159 — the Pay to-do bucket excludes non-payer admins. Arguably consistent with "don't prompt them", but worth confirming.
src/libs/ReportPrimaryActionUtils.ts:523-534 — isPayActionWithAllExpensesHeld disagrees with the main Pay branch in the same function for a non-payer admin with all expenses held.
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.
⚠️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.
The button uses canIOUBePaid, which allows the payer or any admin who can manage payments: isReportPayer || canAdminPayReport(...) (src/libs/ReportUtils.ts:3381).
The badge in getBadgeFromIOUReport first requires isPayer(...) to be true, then calls canIOUBePaid (src/libs/ReportUtils.ts:3486-3499).
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.
In getBadgeFromIOUReport, let the PAY badge show when the user is the payer orcanAdminPayReport(policy, currentUserLogin) is true. Apply this to both the regular pay check and the pay-elsewhere check.
Apply the same change to the pay check in hasOutstandingChildRequest, so the optimistic indicator matches the badge.
Leave isPayer unchanged. Other code relies on it to mean "the designated payer".
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)
Change isPayer to include all admins. I rejected this. It would also change who counts as the designated payer for other features, not just the badge.
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.
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
Activity
applause-bot commentedon Sep 3, 2026
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
aimane-chnaif commentedon Sep 23, 2026
@MelvinBot investigate this
MelvinBot commentedon Sep 23, 2026
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:
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-255incanIOUBePaid:The LHN badge path re-gates on
isPayerbefore that admin path can apply —src/libs/actions/IOU/ReportWorkflow.ts:347-350ingetBadgeFromIOUReport.isPayerdefaults the manual-mode reimburser topolicy.owner(src/libs/ReportUtils.ts:2963) and then returnsisReimburseronly (src/libs/ReportUtils.ts:2983) — so User B isfalse. The same gate is on the client-sidehasOutstandingChildRequestatsrc/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:
tests/actions/IOUTest/ReportWorkflowTest.ts:3749— "allows non-reimburser admin to pay in manual reimbursement mode"tests/actions/IOUTest/ReportWorkflowTest.ts:6015— "should not return PAY badge for non-reimburser admin in manual mode with designated payer"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)returnsisAdmin(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
bankAccountList— that only matters forREIMBURSEMENT_YESworkspaces.Secondary inconsistency worth a separate look
isPrimaryPayActionis called withoutcanNonPayerAdminPayin two places, which is inconsistent with the two callers that passtrue:src/libs/TodosUtils.ts:152-159— the Pay to-do bucket excludes non-payer admins. Arguably consistent with "don't prompt them", but worth confirming.src/libs/ReportPrimaryActionUtils.ts:523-534—isPayActionWithAllExpensesHelddisagrees with the main Pay branch in the same function for a non-payer admin with all expenses held.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
MelvinBot commentedon Oct 23, 2026
Proposal
What is the root cause of that problem?
The Pay button and the Pay badge use different permission checks.
canIOUBePaid, which allows the payer or any admin who can manage payments:isReportPayer || canAdminPayReport(...)(src/libs/ReportUtils.ts:3381).getBadgeFromIOUReportfirst requiresisPayer(...)to be true, then callscanIOUBePaid(src/libs/ReportUtils.ts:3486-3499).On a manual-reimbursement workspace,
isPayerfalls back topolicy.owneras 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
isPayergate is inhasOutstandingChildRequest(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.
getBadgeFromIOUReport, let the PAY badge show when the user is the payer orcanAdminPayReport(policy, currentUserLogin)is true. Apply this to both the regular pay check and the pay-elsewhere check.hasOutstandingChildRequest, so the optimistic indicator matches the badge.isPayerunchanged. Other code relies on it to mean "the 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.canAdminPayReportalready 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)
isPayerto include all admins. I rejected this. It would also change who counts as the designated payer for other features, not just the badge.Notes
hasOutstandingChildRequeston 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.mainwith 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
melvin-bot commentedon Oct 23, 2026
Current assignee @aimane-chnaif is eligible for the External assigner, not assigning anyone new.
[-][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.[/+]melvin-bot commentedon Oct 23, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022113427267635809392
2 remaining items
melvin-bot commentedon Oct 28, 2026
@aimane-chnaif Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Oct 30, 2026
@aimane-chnaif 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Nov 3, 2026
@aimane-chnaif 10 days overdue. I'm getting more depressed than Marvin.
melvin-bot commentedon Nov 3, 2026
@aimane-chnaif 10 days overdue. Is anyone even seeing these? Hello?
melvin-bot commentedon Nov 3, 2026
@aimane-chnaif 10 days overdue. Is anyone even seeing these? Hello?
melvin-bot commentedon Nov 3, 2026
@aimane-chnaif 10 days overdue. Is anyone even seeing these? Hello?
melvin-bot commentedon Nov 5, 2026
@aimane-chnaif 12 days overdue. Walking. Toward. The. Light...
melvin-bot commentedon Nov 5, 2026
@aimane-chnaif 12 days overdue now... This issue's end is nigh!
melvin-bot commentedon Nov 5, 2026
@aimane-chnaif 12 days overdue now... This issue's end is nigh!
jeffrey-graham commentedon Nov 7, 2026
melvin-bot commentedon Nov 7, 2026
melvin-bot commentedon Nov 9, 2026
This issue has not been updated in over 14 days. @aimane-chnaif eroding to Weekly issue.