Open lanitochka17 opened 1 week ago
Triggered auto assignment to @anmurali (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 member - Hidden admin appears in the members list after changing contact method
After adding a second email as a contact method and setting it as the default, the policy.employeeList
will include both the old and new emails as contact methods.
To resolve this issue, it's preferable to reference the data within loginList
, which contains all login email addresses. For each entry in policy?.employeeList
, if the email exists in loginList
and is not equal to policy.owner
, it should not be displayed.
// Skip emails that exist in loginList and are not equal to policy.owner
if (loginList.includes(email) && email !== policy?.owner) { return; }
Note: We can consider using policy.owner
to determine if an email should be excluded. The main goal here is to prevent any secondary email that exists in loginList
from being displayed.
Owner account and Hidden user shows after updating default contact method.
When we update the default contact method, we optimistically update the policy owner to the new default contact method. https://github.com/Expensify/App/blob/5ab6be6ecb01d6398eb2503dbd3f6dad60d6638f/src/libs/actions/User.ts#L879-L889
However, the previous contact method is still listed in the policy employeeList
. The reason the previous contact method shows as Hidden is that we also optimistically update the personal details of the user to the new contact method (email), so the app can't find the previous personal detail anymore.
https://github.com/Expensify/App/blob/5ab6be6ecb01d6398eb2503dbd3f6dad60d6638f/src/libs/actions/User.ts#L818-L825
The badge shows admin because it's not the owner anymore.
When we open the ws members page, the BE response will merge the new contact method to the ws member list.
Optimistically remove the previous contact method and add the new one to the ws member list. https://github.com/Expensify/App/blob/5ab6be6ecb01d6398eb2503dbd3f6dad60d6638f/src/libs/actions/User.ts#L879-L897
employeeList: {
[oldDefaultContactMethod]: null,
[newDefaultContactMethod]: {
role: 'admin'
},
},
(and revert it when fails)
@anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!
Can reproduce on staging
Job added to Upwork: https://www.upwork.com/jobs/~014a16dfba8ca4a44e
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rayane-djouah (External
)
Can reproduce on staging 👍
https://github.com/Expensify/App/assets/77965000/f22b42b2-953c-4be2-bc68-71ed68a2fb47
Reviewing proposals...
@bernhardoj's proposal LGTM
:ribbon::eyes::ribbon: C+ reviewed
Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
📣 @rayane-djouah 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
PR is ready
cc: @rayane-djouah
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.0.3-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Intrnal Team
Action Performed:
Precondition: Use Gmail account to login
Expected Result:
Only owner (with a new email) shown in the members list
Actual Result:
Second member as Hidden (Admin) appears in the list. When user clicks on it 'Hmm.. it's not here page' opens
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/78819774/7fbdf5ea-578d-4742-9ac8-9405d84f43b2
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @rayane-djouah