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

[Awaiting Payment 23rd April] [$500] Web-Workspace -Number of announce room members does not update when remove workspace members #39446

Closed
2 of 6 tasks
lanitochka17 opened this issue Apr 2, 2024 · 21 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Apr 2, 2024

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: 1.4.59-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4468627&group_by=cases:section_id&group_order=asc&group_id=229065
Email or phone of affected tester (no customers): applausetester+gm156@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Log in as a Expensifail account
  2. Create a workspace
  3. Navigate to the Invite members page in workspace> Invite few accounts
  4. Select the invited members and remove them
  5. Send some messages in the #Announce room
  6. Click on header of the room to open Details
  7. Take a note of number of room members

Expected Result:

Number of announce room members should update when user remove workspace users

Actual Result:

Number of announce room members does not update when remove workspace members

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6435770_1712090667330.Recording__2786.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01758a9e58b1dd4c58
  • Upwork Job ID: 1776307639554646016
  • Last Price Increase: 2024-04-08
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Apr 2, 2024
Copy link

melvin-bot bot commented Apr 2, 2024

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

Copy link
Contributor

github-actions bot commented Apr 2, 2024

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

@lanitochka17
Copy link
Author

@jasperhuangg FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@jasperhuangg
Copy link
Contributor

I can reproduce this issue, the only reason it's happening is because the DeleteMembersFromWorkspace command hasn't completed. Once it does, the number correctly updates.

I don't think this needs to be a blocker, but we should update the front-end in this case to optimistically add/remove people from a workspace's default rooms when they are added/removed from the workspace.

@jasperhuangg jasperhuangg added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Apr 3, 2024
Copy link

melvin-bot bot commented Apr 3, 2024

Triggered auto assignment to @trjExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@allgandalf
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Number of active policy members mismatch

What is the root cause of that problem?

When we remove member from policy it takes some time to remove then and their pendingAction is set to delete in the meantime, they are still a part of the policy members list but with a pending action pointing to delete, so if you remove members from workspace and open the report details we see the counter still not updated because here we consider the length of the whole policy members without checking the pending action against them:

translationKey: 'common.members',
icon: Expensicons.Users,
subtitle: participants.length,

const participants = useMemo(() => ReportUtils.getVisibleMemberIDs(report), [report]);

Note that if we open the members page we will see only the members which do not have a pending action against their accountID, so this bug is not related to adding data optimistically but rather a bug which is due to not checking if the participant has any pending action.

What changes do you think we should make in order to solve the problem?

To resolve this, we should recalculate the length of the array by introducing a new const which will count only those accountIDs which don't have any pending action against them:

    const NonpendingChatMembers = report?.participantAccountIDs
    ?.map((accountID) => report.pendingChatMembers?.findLast((member) => member.accountID === accountID.toString()))
    .filter(member => !member || member.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);

    

The above condition can be further improved but basic idea remains the same

Note We need to only remove those who have pending action as delete, we need to show the count of those who were recently added

And then pass NonpendingChatMembers.length below instead in subtitle field:

translationKey: 'common.members',
icon: Expensicons.Users,
subtitle: participants.length,

Result video

simplescreenrecorder-2024-04-04_03.14.26.mp4

@allgandalf
Copy link
Contributor

Can you add a external label here @jasperhuangg , we don't have a C+ to review the PR :) thanks for assignment

@jasperhuangg jasperhuangg added the External Added to denote the issue can be worked on by a contributor label Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

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

@melvin-bot melvin-bot bot changed the title Web-Workspace -Number of announce room members does not update when remove workspace members [$250] Web-Workspace -Number of announce room members does not update when remove workspace members Apr 5, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

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

@allgandalf
Copy link
Contributor

Thanks, PR would be ready by EOD

@allgandalf
Copy link
Contributor

PR ready for review c.c. @rayane-djouah 🍾

@allgandalf
Copy link
Contributor

I also had one question, as this issue was created before the new payment structure :

Any issues created before this date will maintain their original stated price.

So i was wondering if this should maintain $500? @trjExpensify ? @jasperhuangg

@jasperhuangg
Copy link
Contributor

@GandalfGwaihir Thanks for pointing that out, agree that it was created before the new payment structure was announced. @trjExpensify I'm gonna go ahead and update the price to $500, feel free to change it back if you disagree.

@jasperhuangg jasperhuangg changed the title [$250] Web-Workspace -Number of announce room members does not update when remove workspace members [$500] Web-Workspace -Number of announce room members does not update when remove workspace members Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

Upwork job price has been updated to $500

@allgandalf
Copy link
Contributor

allgandalf commented Apr 8, 2024

Thanks @jasperhuangg 😄, PR is in works, i purchased new laptop so configuring it currently for all platforms, PR should get merged by Thursday.

@allgandalf
Copy link
Contributor

This hit production yesterday, automation failed, can you update the title manually @trjExpensify

@trjExpensify
Copy link
Contributor

Confirming payment summary as follows:

  • $500 to @GandalfGwaihir for the fix - offer sent
  • $500 to @rayane-djouah for the C+ review - offer sent

@trjExpensify trjExpensify added Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 and removed Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2 labels Apr 24, 2024
@trjExpensify trjExpensify changed the title [$500] Web-Workspace -Number of announce room members does not update when remove workspace members [Awaiting Payment 23rd April] [$500] Web-Workspace -Number of announce room members does not update when remove workspace members Apr 24, 2024
@trjExpensify
Copy link
Contributor

@GandalfGwaihir paid!

@rayane-djouah
Copy link
Contributor

@trjExpensify, Offer accepted, Thanks!

@rayane-djouah
Copy link
Contributor

@trjExpensify, Friendly bump 😄

@trjExpensify
Copy link
Contributor

Paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

5 participants