Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[$500] Manage members - Page is blinking after removing user from Workspace #8927

Closed
kbecciv opened this issue May 10, 2022 · 57 comments
Closed
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented May 10, 2022

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Launch the app
  2. Go to Setting > Workspace > Manage members
  3. Invite few members(if you haven't)
  4. Delete the member

Expected Result:

Page is not blinking after removing user from Workspace

Actual Result:

Page is blinking after removing user from Workspace

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Desktop App
  • Mobile Web

Version Number: 1.1.57.12

Reproducible in staging?: Yes

Reproducible in production?: Yes

Email or phone of affected tester (no customers): any

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

ios.8689.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause

Slack conversation:

View all open jobs on GitHub

@melvin-bot
Copy link

melvin-bot bot commented May 10, 2022

Triggered auto assignment to @TomatoToaster (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@kbecciv kbecciv changed the title IOS -Manage members - Page is blinking after removing user from Workspace Manage members - Page is blinking after removing user from Workspace May 10, 2022
@TomatoToaster TomatoToaster added the External Added to denote the issue can be worked on by a contributor label May 12, 2022
@melvin-bot
Copy link

melvin-bot bot commented May 12, 2022

Triggered auto assignment to @adelekennedy (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@adelekennedy
Copy link

internal
external

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels May 13, 2022
@melvin-bot
Copy link

melvin-bot bot commented May 13, 2022

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label May 13, 2022
@melvin-bot
Copy link

melvin-bot bot commented May 13, 2022

Triggered auto assignment to @deetergp (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot changed the title Manage members - Page is blinking after removing user from Workspace [$250] Manage members - Page is blinking after removing user from Workspace May 13, 2022
@thesahindia
Copy link
Member

thesahindia commented May 14, 2022

Proposal

When we remove a member removeMembers function gets called and inside it we update the policy after removing the users using Onyx.set

// Make a shallow copy to preserve original data and remove the members
const policy = _.clone(allPolicies[key]);
policy.employeeList = _.without(policy.employeeList, ...members);
// Optimistically remove the members from the policy
Onyx.set(key, policy);

We are doing the same thing again here. It's not needed and removing it will solve this.

function subscribeToPolicyEvents() {
_.each(allPolicies, (policy, key) => {
const pusherChannelName = `public-policyEditor-${policy.id}${CONFIG.PUSHER.SUFFIX}`;
Pusher.subscribe(pusherChannelName, 'policyEmployeeRemoved', ({removedEmails, policyExpenseChatIDs, defaultRoomChatIDs}) => {
const policyWithoutEmployee = _.clone(policy);
policyWithoutEmployee.employeeList = _.without(policy.employeeList, ...removedEmails);
// Remove the members from the policy
Onyx.set(key, policyWithoutEmployee);

I propose the following changes -

function subscribeToPolicyEvents() {
-    _.each(allPolicies, (policy, key) => {
+    _.each(allPolicies, (policy) => {
        const pusherChannelName = `public-policyEditor-${policy.id}${CONFIG.PUSHER.SUFFIX}`;
        Pusher.subscribe(pusherChannelName, 'policyEmployeeRemoved', ({removedEmails, policyExpenseChatIDs, defaultRoomChatIDs}) => {
-            const policyWithoutEmployee = _.clone(policy);
-            policyWithoutEmployee.employeeList = _.without(policy.employeeList, ...removedEmails);
-
-            // Remove the members from the policy
-            Onyx.set(key, policyWithoutEmployee);

            // Refetch the policy expense chats to update their state
            if (!_.isEmpty(policyExpenseChatIDs)) {
                Report.fetchChatReportsByIDs(policyExpenseChatIDs);
            }

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 14, 2022
@mananjadhav
Copy link
Collaborator

mananjadhav commented May 15, 2022

@thesahindia I went through your proposal. Based on what I see, policyEmployeeRemoved is an event subscribed via Pusher, so I am guessing it is to sync between devices. If we remove this, it might not sync.

@deetergp
Copy link
Contributor

I agree with @mananjadhav — we're going to need that value in Onyx & for Pusher.

@melvin-bot melvin-bot bot added the Overdue label May 19, 2022
@deetergp
Copy link
Contributor

Switching this back to Weekly since we're still open to more proposals.

@melvin-bot melvin-bot bot removed the Overdue label May 19, 2022
@deetergp
Copy link
Contributor

I missed adding the weekly label

@melvin-bot melvin-bot bot removed the Overdue label Jun 17, 2022
@deetergp
Copy link
Contributor

Also, bumping @adelekennedy to re-add the job in Upwork so @thesahindia can start work on it.

@adelekennedy
Copy link

reopened! @thesahindia do you mind applying here?

@thesahindia
Copy link
Member

reopened! @thesahindia do you mind applying here?

Applied ✅

@mananjadhav
Copy link
Collaborator

@thesahindia Any updates for me on this one?

@thesahindia
Copy link
Member

@mananjadhav, I have pushed the code now.

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@melvin-bot melvin-bot bot added the Overdue label Jul 4, 2022
@adelekennedy
Copy link

Still going through tests - not overdue

@melvin-bot melvin-bot bot removed the Overdue label Jul 4, 2022
@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@melvin-bot melvin-bot bot added the Overdue label Jul 12, 2022
@deetergp
Copy link
Contributor

@adelekennedy It looks like this one is good to go and we should pay @thesahindia for their effort 👍

@melvin-bot melvin-bot bot removed the Overdue label Jul 13, 2022
@adelekennedy
Copy link

@deetergp ty ty, I'll pay this out in 7 days!

@mananjadhav
Copy link
Collaborator

This hit production but the title wasn't updated

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Third week)

@mananjadhav
Copy link
Collaborator

@adelekennedy Quick bump. The regression period is complete. PR was deployed 8 days back. For some reason title wasn't updated.

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Fourth week) Are we good to close this?

@mananjadhav
Copy link
Collaborator

@mvtglobally Payments are pending for this one. We can close this out once that is through.

@adelekennedy quick reminder

@deetergp deetergp added the Reviewing Has a PR in review label Jul 26, 2022
@adelekennedy
Copy link

Hmm, do we know why the title didn't change? Happy to pay out but I'm concerned that something is broken here @deetergp

@adelekennedy
Copy link

No reporting bonus, C+: @mananjadhav, Contributor: @thesahindia

@thesahindia
Copy link
Member

Bump for upwork.
cc: @adelekennedy

@mananjadhav
Copy link
Collaborator

bump @adelekennedy @deetergp for Upwork

@adelekennedy
Copy link

Strange - I'm not getting any notifications from this GH, I just sent the payment through with a bonus for waiting

@mananjadhav
Copy link
Collaborator

Thanks @adelekennedy for the quick TAT and bonus 🤑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants