Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.2.60-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: Exp https://test-management.browserstack.com/projects/2219752/test-runs/TR-2009/folder/13177080/41237947/1022757418
Email or phone of affected tester (no customers): applausetester+181103kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.5 / Chrome
App Component: Workspace Settings
Action Performed:
Precondition:
- User B has secondary login.
- Perform the steps below as User A:
- Go to staging.new.expensify.com
- Create a workspace.
- Go to workspace settings > Members.
- Click Invite member.
- Enter User B's secondary login.
- Select the secondary login and invite the user.
- Remove the invited user.
- Click Invite member.
- Enter User B's secondary login.
BUG 1: User B's secondary login is displayed as "already a member of Workspace". - Close the RHP.
- Go to workspace settings > Workflows.
- Click on the default approval workflow.
- Click Approver.
BUG 2: User B's secondary login is still displayed on the list, when it should have been removed.
Expected Result:
BUG 1: User should be able to invite User B by secondary login after removing User B from the workspace.
BUG 2: User B's secondary login will not appear on the approver list, because User B is removed.
Actual Result:
BUG 1: User B's secondary login is displayed as "already a member of Workspace".
BUG 2: User B's secondary login is still displayed on the list, when it should have been removed.
Workaround:
Unknown
Platforms:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Bug7008071_1763542584706.21.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021991587643283375702
- Upwork Job ID: 1991587643283375702
- Last Price Increase: 2025-11-27
- Automatic offers:
- LorenzoBloedow | Contributor | 109671169
Issue Owner
Current Issue Owner: @amyevansMetadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Nov 19, 2025
Triggered auto assignment to @Christinadobrzyn (
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.[-]Workspace - Secondary login is shown as workspace member after removing member from workspace[/-][+][$250] Workspace - Secondary login is shown as workspace member after removing member from workspace[/+]melvin-bot commentedon Nov 20, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021991587643283375702
melvin-bot commentedon Nov 20, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (
External)Christinadobrzyn commentedon Nov 20, 2025
I can reproduce with the steps in the OP - the steps are outline really well!
LorenzoBloedow commentedon Nov 23, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-11-28 14:57:54 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
After removing a user invited with a secondary login, it stays in the approval workflow menu and if you try to invite the same user the button gets disabled and you get "already a member of Workspace".
What is the root cause of that problem?
When inviting a user with the secondary login, we don't know it's a secondary login and not the primary, so, because of our optimistic design, we end up storing the secondary login in the policy's
employeeListand then, when we callOPEN_WORKSPACE_MEMBERS_PAGE, the BE returns the primary login as an onyx update, so we end up with both logins.In addition to this, the BE never returns personal details data for the secondary login, so we're left with a "detached" login in
employeeListbecause we can't associate it with the same account ID as the primary login returned by the BE.Because we now have both logins (one detached), after removing a user (the primary login) we're still left with the secondary login in
employeeList, this is why we see it in the workflow approvers list and can't add them as a member again.What changes do you think we should make in order to solve the problem?
Detect and remove duplicate members when removing regular members:
Put this here:
App/src/libs/actions/Policy/Member.ts
Lines 428 to 432 in 236b291
What alternative solutions did you explore? (Optional)
We could try filtering by account IDs and ignore
employeeList, like it's being done in the members list already. Doesn't sound like the best idea though,employeeListis being used here probably for a reason.We could also try setting the
employeeListinstead of merging (BE change) so whenever we callOPEN_WORKSPACE_MEMBERS_PAGEwe get the entireemployeeListwith just the primary logins and override the local one. This might not scale well to policies with many members though.We could use a middleware as shown in my previous proposal, but I have identified 1 bug with that approach where we can invite the same user twice if we use the secondary login.
Result:
secondary-login-fix.mov
Christinadobrzyn commentedon Nov 24, 2025
hi @akinwale can you please check out the above proposal? TY!
22 remaining items
Christinadobrzyn commentedon Dec 12, 2025
I'll be ooo until 12/21. Adding a BZ teammate to pay this out when the time comes.
melvin-bot commentedon Dec 12, 2025
Triggered auto assignment to @JmillsExpensify (
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.Christinadobrzyn commentedon Dec 12, 2025
@JmillsExpensify this is going to need to be paid while I'm ooo if you can help with that!
Payment Summary
Contributor: @LorenzoBloedow paid $250 via Upwork offer
Contributor+: @akinwale due $250 via NewDot
@akinwale do we need a regression test?
akinwale commentedon Dec 15, 2025
BugZero Checklist:
[@akinwale] 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
[@akinwale] 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:
[@akinwale] 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:
Regression Test Proposal
Test:
Do we agree 👍 or 👎?
JmillsExpensify commentedon Dec 17, 2025
Upwork contract paid out. Please request via ND!
quinthar commentedon Dec 18, 2025
Approved $250 to @akinwale