[$250] Workspace - Admin becomes approver when dismiss error message for deleting approver
If you havenβt already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v9.2.57-0 Reproducible in staging?: Yes Reproducible in production?: Unable to check in Prod becourse of KI If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://github.com/Expensify/App/pull/74710 Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Device used: Lenovo 80ES / Windows 10 Pro App Component: Workspace Settings
Action Performed:
- Go to staging.new.expensify.com
- As an admin, create a workspace and invite user A
- Enable approval and change approver to user A
- Create and submit a manual expense as an admin in workspace chat
- Remove user A
- Dismiss the error message
- Go to Workflow> Add approvals
Expected Result:
After dismissing the error message Approver A should still be approver
Actual Result:
Admin becomes approver when dismiss error message for deleting approver member
Workaround:
Unknown
Platforms:
- [ ] Android: App
- [x] Android: mWeb Chrome
- [ ] iOS: App
- [ ] iOS: mWeb Safari
- [ ] iOS: mWeb Chrome
- [x] Windows: Chrome
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/f9bbf739-b3a5-4edf-b083-7d7c5e75d5e3
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021989068132134821633
- Upwork Job ID: 1989068132134821633
- Last Price Increase: 2025-12-25
Issue Owner
Current Issue Owner: @brunovjk
Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Triggered auto assignment to @marcaaron (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.
π¬ A slack conversation has been started in #expensify-open-source
:wave: 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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
Demoting as per this Slack thread
Job added to Upwork: https://www.upwork.com/jobs/~021989068132134821633
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)
I would guess this is a problem with Onyx data and not BE, but let's see. failureData most likely needs to revert some change to the approval workflow that gets updated when removing a workspace member. At least, I hope this is it π
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
Still waiting for proposals.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@strepanier03 @marcaaron @brunovjk this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
@brunovjk 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@brunovjk Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!
Update: Still waiting for proposals.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@strepanier03 @marcaaron @brunovjk this issue is now 4 weeks old, please consider:
- Finding a contributor to fix the bug
- Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
- If you have any questions, don't hesitate to start a discussion in #expensify-open-source
Thanks!
@brunovjk Whoops! This issue is 2 days overdue. Let's get this updated quick!
Update: Still waiting for proposals.
Same as above
@brunovjk Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Bug still reproducible (Dec 16 - v9.2.78-6). Awaiting proposals
https://github.com/user-attachments/assets/a2a750da-08cc-42e1-b258-412e625a4a25
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an admin attempts to delete a member who is also an approver, the process may partially fail. If the deletion error message is dismissed, the admin is unintentionally promoted to the approver role because the approval settings were updated despite the member deletion failing.
What is the root cause of that problem?
The app currently triggers UpdateWorkspaceApproval or RemoveWorkspaceApproval alongside DeleteMembersFromWorkspace. Because these API calls are not synchronized, the approval logic succeeds and persists even if the member deletion fails due to backend validation
Reference: https://github.com/Expensify/App/blob/9022a67ba8773c479335b0dbf8537853ba58314d/src/pages/workspace/WorkspaceMembersPage.tsx#L236-L252
What changes do you think we should make in order to solve the problem?
Solution 1: Implement front-end validation to detect if a member has outstanding expense reports. We should display a modal to block the execution of both DeleteMembersFromWorkspace and the approval update APIs.
Solution 2: Introduce a dependency between the API calls. We should wait for the DeleteMembersFromWorkspace request to complete successfully before initiating the UpdateWorkspaceApproval call. (Using callback then)
Solution 3: Align with the app's "1:1:1" philosophy by consolidating the approval update and removal logic directly into the DeleteMembersFromWorkspace API, ensuring the operation is atomic.
What alternative solutions did you explore? (Optional)
@brunovjk In this proposal, I am outlining the high-level concepts for the fix. I will provide the specific technical details and implementation steps once we have agreed on the preferred approach.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
@brunovjk Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Not overdue, I'll review it ASAP. Thanks.
@brunovjk Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Sorry for the delay, the issue is on my list, I'll review it ASAP. Working reduced hours this week, If it's very urgent, please reassign.
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ