App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Workspace - Admin becomes approver when dismiss error message for deleting approver

Open jponikarchuk opened this issue 2 months ago β€’ 30 comments

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:

  1. Go to staging.new.expensify.com
  2. As an admin, create a workspace and invite user A
  3. Enable approval and change approver to user A
  4. Create and submit a manual expense as an admin in workspace chat
  5. Remove user A
  6. Dismiss the error message
  7. 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

View all open jobs on GitHub

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 OwnerCurrent Issue Owner: @brunovjk

jponikarchuk avatar Nov 13 '25 06:11 jponikarchuk

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.

melvin-bot[bot] avatar Nov 13 '25 06:11 melvin-bot[bot]

Triggered auto assignment to @marcaaron (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] avatar Nov 13 '25 06:11 melvin-bot[bot]

πŸ’¬ A slack conversation has been started in #expensify-open-source

melvin-bot[bot] avatar Nov 13 '25 06:11 melvin-bot[bot]

: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:

  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.

github-actions[bot] avatar Nov 13 '25 06:11 github-actions[bot]

Demoting as per this Slack thread

cristipaval avatar Nov 13 '25 10:11 cristipaval

Job added to Upwork: https://www.upwork.com/jobs/~021989068132134821633

melvin-bot[bot] avatar Nov 13 '25 20:11 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)

melvin-bot[bot] avatar Nov 13 '25 20:11 melvin-bot[bot]

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 πŸ˜„

marcaaron avatar Nov 13 '25 20:11 marcaaron

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Nov 20 '25 16:11 melvin-bot[bot]

Still waiting for proposals.

brunovjk avatar Nov 26 '25 21:11 brunovjk

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Nov 27 '25 16:11 melvin-bot[bot]

@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!

melvin-bot[bot] avatar Nov 27 '25 21:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 04 '25 00:12 melvin-bot[bot]

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 04 '25 16:12 melvin-bot[bot]

@brunovjk Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

melvin-bot[bot] avatar Dec 05 '25 23:12 melvin-bot[bot]

Update: Still waiting for proposals.

brunovjk avatar Dec 08 '25 16:12 brunovjk

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 11 '25 16:12 melvin-bot[bot]

@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!

melvin-bot[bot] avatar Dec 11 '25 22:12 melvin-bot[bot]

@brunovjk Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 11 '25 23:12 melvin-bot[bot]

Update: Still waiting for proposals.

Same as above

brunovjk avatar Dec 12 '25 10:12 brunovjk

@brunovjk Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 15 '25 23:12 melvin-bot[bot]

Bug still reproducible (Dec 16 - v9.2.78-6). Awaiting proposals

https://github.com/user-attachments/assets/a2a750da-08cc-42e1-b258-412e625a4a25

brunovjk avatar Dec 16 '25 13:12 brunovjk

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)

cretadn22 avatar Dec 17 '25 12:12 cretadn22

@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.

cretadn22 avatar Dec 17 '25 12:12 cretadn22

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 18 '25 16:12 melvin-bot[bot]

@brunovjk Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 19 '25 23:12 melvin-bot[bot]

Not overdue, I'll review it ASAP. Thanks.

brunovjk avatar Dec 20 '25 18:12 brunovjk

@brunovjk Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Dec 23 '25 23:12 melvin-bot[bot]

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.

brunovjk avatar Dec 24 '25 14:12 brunovjk

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Dec 25 '25 16:12 melvin-bot[bot]