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 2025-02-27] [$250] Workspace - Admin-users are displayed in the #Admins room members list after being deleted #56525
Version Number: v9.0.95-0 Reproducible in staging?: Yes Reproducible in production?: Yes Issue reported by: Applause Internal Team Device used: Mac 15.2/Safari App Component: Workspace Settings
Please re-state the problem that we are trying to solve in this issue.
Removed admin is still displayed on the admins room members.
What is the root cause of that problem?
When we remove the member from workspace, the API still return the removed user as the member of the admins report. This is a BE issue. However, on the FE, we also don't optimistically remove the user from the admins room.
We currently only optimistically remove the user from the announce rooms.
What changes do you think we should make in order to solve the problem?
This should be fixed on the BE. For the optimistic part, we can create a new function called removeOptimisticAdminRoomMembers similar to removeOptimisticAnnounceRoomMembers. The logic will be the same as removeOptimisticAnnounceRoomMembers except we will get the admin room.
I notice that we also don't optimistically add the admin to the admins room. If we would like to do it too, we can again follow a similar logic to buildAnnounceRoomMembersOnyxData. We will need to add this when adding new members and updating the role (admin/auditor).
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can test removeMembers and assert that when removing admin, the admin is removed from the admin room. If we want to add optimistic data when adding admin too, then we need to test addMembersToWorkspace too.
changed the title [-]Workspace - Admin-users are displayed in the #Admins room members list after being deleted[/-][+][$250] Workspace - Admin-users are displayed in the #Admins room members list after being deleted[/+]on Feb 11, 2025
@bernhardoj Thanks for the proposal. After a member is removed, the BE API response returns the correct report.participants (i.e. the removed members are removed correctly) however since the Onyx method is MERGE, the participants objects are merged and the old values persist. Do you know if this problem occurs on rooms / group chats too? We can follow the same solution
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.1-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@s77rt@bfitzexpensify@s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[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: n/a
[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: n/a
[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.
Bug requires regression test: Yes but let's add the test after the BE bug is fixed
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
A workspace
Test:
Go to Settings > Workspaces > Workspace > Members
Invite a member as an admin
Go to the #admins room
Verify that the invited member is a member of the room
Go to Settings > Workspaces > Workspace > Members
Remove the invited member
Go to the #admins room
Verify that the removed member is no longer a member of the room
Activity
melvin-bot commentedon Feb 7, 2025
Triggered auto assignment to @bfitzexpensify (
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.bernhardoj commentedon Feb 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Removed admin is still displayed on the admins room members.
What is the root cause of that problem?
When we remove the member from workspace, the API still return the removed user as the member of the admins report. This is a BE issue. However, on the FE, we also don't optimistically remove the user from the admins room.
We currently only optimistically remove the user from the announce rooms.
App/src/libs/actions/Policy/Member.ts
Line 329 in 33a03bf
What changes do you think we should make in order to solve the problem?
This should be fixed on the BE. For the optimistic part, we can create a new function called
removeOptimisticAdminRoomMemberssimilar toremoveOptimisticAnnounceRoomMembers. The logic will be the same asremoveOptimisticAnnounceRoomMembersexcept we will get the admin room.App/src/libs/actions/Policy/Member.ts
Line 245 in 33a03bf
To use
removeOptimisticAdminRoomMembers, we will pass a filteraccountIDsthat only contains admin IDs.This will optimistically mark the member as removed. We will need to add this when removing members (
removeMembers) and updating the role.For role update, we will only remove if we update the role to user/member.
I notice that we also don't optimistically add the admin to the admins room. If we would like to do it too, we can again follow a similar logic to
buildAnnounceRoomMembersOnyxData. We will need to add this when adding new members and updating the role (admin/auditor).App/src/libs/actions/Policy/Member.ts
Line 678 in 33a03bf
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can test
removeMembersand assert that when removing admin, the admin is removed from the admin room. If we want to add optimistic data when adding admin too, then we need to testaddMembersToWorkspacetoo.melvin-bot commentedon Feb 10, 2025
@bfitzexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!
[-]Workspace - Admin-users are displayed in the #Admins room members list after being deleted[/-][+][$250] Workspace - Admin-users are displayed in the #Admins room members list after being deleted[/+]melvin-bot commentedon Feb 11, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021889445311434361818
melvin-bot commentedon Feb 11, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt (
External)s77rt commentedon Feb 12, 2025
@bernhardoj Thanks for the proposal. After a member is removed, the BE API response returns the correct
report.participants(i.e. the removed members are removed correctly) however since the Onyx method is MERGE, the participants objects are merged and the old values persist. Do you know if this problem occurs on rooms / group chats too? We can follow the same solution43 remaining items
melvin-bot commentedon Feb 20, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Feb 20, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.1-6 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 2025-02-27. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Feb 20, 2025
@s77rt @bfitzexpensify @s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
s77rt commentedon Feb 24, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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: n/a
[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: n/a
[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.
Bug requires regression test: Yes but let's add the test after the BE bug is fixed
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
#adminsroom#adminsroomDo we agree 👍 or 👎
melvin-bot commentedon Feb 27, 2025
Payment Summary
Upwork Job
BugZero Checklist (@bfitzexpensify)
bernhardoj commentedon Feb 27, 2025
Requested in ND.
JmillsExpensify commentedon Mar 3, 2025
Can I get a confirmed payment summary when you get a chance @bfitzexpensify
bfitzexpensify commentedon Mar 4, 2025
Payment summary:
Reviewer: @s77rt owed $250 via NewDot
Reviewer: @bernhardoj owed $250 via NewDot
JmillsExpensify commentedon Mar 5, 2025
$250 approved for @s77rt
JmillsExpensify commentedon Mar 5, 2025
$250 approved for @bernhardoj