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
[Due for payment 2026-09-25] Change approver - No error message when remove approver #98764
Version Number: v9.4.54-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/53697091/test-cases/87848130 Email or phone of affected tester (no customers): - Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Ventura / Chrome App Component: Other
Action Performed:
Preconditions:
User is an Admin of a Control Workspace
At least one other member is added to the Workspace
Workflow / Approvals are enabled for the workspace
STR:
Navigate to the Workspace chat
Create a manual expense and submit
Open the newly created expense report
Navigate to report details
Click More > Change approver
Select the workspace member as approver
Navigate to Workspace Settings > [Workspace Name] > Members
Select the checkbox next to the member who was just assigned as the approver
Click the 1 selected dropdown > Click "Remove member"
Click "Remove" on the modal
Expected Result:
An error message is displayed: "xxx has outstanding expense reports to approve. Please ask them to approve, or take control of their reports before removing them from the workspace"
Actual Result:
No error message. Member just deleted from the list
Removing a workspace member who is the approver of an outstanding expense report succeeds silently. The expected blocking error — "…has outstanding expense reports to approve. Please ask them to approve, or take control of their reports before removing them from the workspace." — is never shown.
I reproduced this end-to-end on web (Control workspace, Approvals enabled): after setting a member as a report's approver via Change approver, removing them from Members showed only the generic "Are you sure you want to remove …?" modal and removed them immediately. The report silently reverted to the workspace owner for approval instead of blocking removal. Evidence screenshots are attached above.
Root Cause
The member-removal flows decide whether a member is an "approver" solely from isPolicyApprover(), which inspects only the workspace approval-workflow config (policy.approver and employeeListsubmitsTo/forwardsTo/overLimitForwardsTo).
The Change approver action (addReportApprover) is report-scoped — it writes the report's managerID, a report action, and nextStep, but never touches the policy config. So a member who is only an ad-hoc report approver is invisible to isPolicyApprover(), and neither removal flow ever checks for reports the member still has to approve.
Additionally, the language string the reporter expected — workspace.people.removeMemberPromptPendingApproval at en.ts:6810 — is dead copy: it exists but has no reference anywhere in code (same for cannotRemoveUserDueToReport). The "pending approval" guard was never wired up.
Investigation details & evidence
Bulk flow (STR path — Members list → "1 selected" → Remove member):
WorkspaceMembersPage.tsx:164-190 — the confirm prompt only branches on isPolicyApprover / exporter, else falls through to the generic removeMembersPrompt. No outstanding-report check.
WorkspaceMembersPage.tsx:230-266 — on confirm, removeMembers() is called unconditionally; there is no gate that can block removal.
Single-member flow (WorkspaceMemberDetailsPage.tsx:181-201) — richer branching (removeMemberPromptApprover, reimburser, exporter, techContact) but still gated on the same isPolicyApprover config check and has no "outstanding reports to approve" branch either.
Note on getOutstandingReportsForUser / OUTSTANDING_REPORTS_BY_POLICY_ID: that existing derived value keys reports by owner/submitter (ownerAccountID), so it answers "reports a member submitted", not "reports a member must approve". The needed signal is different — reports where managerID === accountID (or the ad-hoc approver) that are awaiting that member's approval.
Alternatives considered: A server-side error on the removal command is possible, but the interpolated (memberName) => … string living in App's en.ts indicates this warning was intended to be rendered client-side. isPolicyApprover returning false here is correct for its own purpose (workflow config) — the bug is the missing pending-approval check, not a bug in isPolicyApprover.
Suggested Fix
Add a "does this member still have reports to approve?" check to both removal flows and surface removeMemberPromptPendingApproval (as a blocking error, matching the expected behavior) when it's true:
Add a helper (e.g. in ReportUtils/PolicyUtils) that returns reports on the policy whose managerID equals the member's accountID and that are in a state awaiting approval (open/submitted, not settled/closed) — covering ad-hoc Change approver assignments, not just workflow config.
In WorkspaceMembersPage.tsx and WorkspaceMemberDetailsPage.tsx, when the member(s) to remove have such reports, show removeMemberPromptPendingApproval and block the removal (disable/short-circuit the Remove action) instead of proceeding.
Confidence: High — code path and web reproduction agree.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/98764) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-][Due for payment 2026-09-23] Change approver - No error message when remove approver[/-][+][Due for payment 2026-09-25] Change approver - No error message when remove approver[/+]on Sep 18, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.89-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-09-25. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: Not Required. The existing checklist is good enough to capture such issues.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
At least one other member is added to the Workspace
Workflow / Approvals are enabled for the workspace
Test:
Navigate to the Workspace chat
Create a manual expense and submit
Open the newly created expense report
Navigate to report details
Click More > Change approver
Select the workspace member as approver
Navigate to Workspace Settings > [Workspace Name] > Members
Select the checkbox next to the member who was just assigned as the approver
Click the 1 selected dropdown > Click "Remove member"
Click "Remove" on the modal
Verify that the warning modal is shown with messae: Approver x is an approver in this workspace. When you unshare this workspace with them, we'll replace them in the approval workflow with the workspace owner, y
Activity
applause-bot commentedon Aug 17, 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/c9f0e9106e482866c640a2d0cf7e9b7bdf5728256a68b4387d359315e36b561c
MelvinBot commentedon Aug 17, 2026
Proposal
Problem
Removing a workspace member who is the approver of an outstanding expense report succeeds silently. The expected blocking error — "…has outstanding expense reports to approve. Please ask them to approve, or take control of their reports before removing them from the workspace." — is never shown.
I reproduced this end-to-end on web (Control workspace, Approvals enabled): after setting a member as a report's approver via Change approver, removing them from Members showed only the generic "Are you sure you want to remove …?" modal and removed them immediately. The report silently reverted to the workspace owner for approval instead of blocking removal. Evidence screenshots are attached above.
Root Cause
The member-removal flows decide whether a member is an "approver" solely from
isPolicyApprover(), which inspects only the workspace approval-workflow config (policy.approverandemployeeListsubmitsTo/forwardsTo/overLimitForwardsTo).The Change approver action (
addReportApprover) is report-scoped — it writes the report'smanagerID, a report action, andnextStep, but never touches the policy config. So a member who is only an ad-hoc report approver is invisible toisPolicyApprover(), and neither removal flow ever checks for reports the member still has to approve.Additionally, the language string the reporter expected —
workspace.people.removeMemberPromptPendingApprovalaten.ts:6810— is dead copy: it exists but has no reference anywhere in code (same forcannotRemoveUserDueToReport). The "pending approval" guard was never wired up.Investigation details & evidence
Bulk flow (STR path — Members list → "1 selected" → Remove member):
WorkspaceMembersPage.tsx:164-190— the confirm prompt only branches onisPolicyApprover/ exporter, else falls through to the genericremoveMembersPrompt. No outstanding-report check.WorkspaceMembersPage.tsx:230-266— on confirm,removeMembers()is called unconditionally; there is no gate that can block removal.Single-member flow (
WorkspaceMemberDetailsPage.tsx:181-201) — richer branching (removeMemberPromptApprover, reimburser, exporter, techContact) but still gated on the sameisPolicyApproverconfig check and has no "outstanding reports to approve" branch either.Note on
getOutstandingReportsForUser/OUTSTANDING_REPORTS_BY_POLICY_ID: that existing derived value keys reports by owner/submitter (ownerAccountID), so it answers "reports a member submitted", not "reports a member must approve". The needed signal is different — reports wheremanagerID === accountID(or the ad-hoc approver) that are awaiting that member's approval.Alternatives considered: A server-side error on the removal command is possible, but the interpolated
(memberName) => …string living in App'sen.tsindicates this warning was intended to be rendered client-side.isPolicyApproverreturningfalsehere is correct for its own purpose (workflow config) — the bug is the missing pending-approval check, not a bug inisPolicyApprover.Suggested Fix
Add a "does this member still have reports to approve?" check to both removal flows and surface
removeMemberPromptPendingApproval(as a blocking error, matching the expected behavior) when it's true:ReportUtils/PolicyUtils) that returns reports on the policy whosemanagerIDequals the member'saccountIDand that are in a state awaiting approval (open/submitted, not settled/closed) — covering ad-hoc Change approver assignments, not just workflow config.WorkspaceMembersPage.tsxandWorkspaceMemberDetailsPage.tsx, when the member(s) to remove have such reports, showremoveMemberPromptPendingApprovaland block the removal (disable/short-circuit the Remove action) instead of proceeding.Confidence: High — code path and web reproduction agree.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/98764)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Aug 17, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (
External)melvin-bot commentedon Aug 17, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022089311619201881742
Uzaifm127 commentedon Aug 20, 2026
@aimane-chnaif
I reviewed the Melvin proposal and found:
This line in Melvin proposal's root cause is incorrect:
A real regression in its proposal:
Melvin-regression.mp4
I believe a better proposal than Melvin is possible and I have a better one.
melvin-bot commentedon Aug 20, 2026
@aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Uzaifm127 commentedon Aug 21, 2026
@mallenexpensify We aren't getting any response from @aimane-chnaif on this issue (maybe they aren't available).
I left a comment pointing out the issues in Melvin proposal in this comment.
Could you please help us to move this issue further as per this Slack thread, thanks.
41 remaining items
[-][Due for payment 2026-09-23] Change approver - No error message when remove approver[/-][+][Due for payment 2026-09-25] Change approver - No error message when remove approver[/+]melvin-bot commentedon Sep 18, 2026
@rojiphil
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.89-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-09-25. 🎊
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]
melvin-bot commentedon Sep 21, 2026
@rojiphil Eep! 4 days overdue now. Issues have feelings too...
melvin-bot commentedon Sep 23, 2026
@rojiphil 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
melvin-bot commentedon Sep 24, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Sep 24, 2026
Payment Summary
Resolving PRs:
Warn when removing a member who approves outstanding reports #101047
warn when leaving a workspace with reports to approve #101352
Reviewer: @rojiphil owed $175 via NewDot
Contributor: @dukenv0307 does not require payment (Contractor)
BugZero Checklist (@mallenexpensify)
rojiphil commentedon Sep 25, 2026
BugZero Checklist:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: Not Required. The existing checklist is good enough to capture such issues.
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/685500
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-6268-aa77-07a2-3d7022fef1b4rojiphil commentedon Sep 25, 2026
@mallenexpensify BugZero checklist done.
Also, compensation is $250 here as the job was assigned before Sept 19
mallenexpensify commentedon Sep 26, 2026
Payment Summary
Contributor+: @rojiphil due $250 via NewDot
quinthar commentedon Oct 18, 2026
Approved $250 to @rojiphil