Skip to content

[HOLD for payment 2024-06-13] [$250] mWeb - Members - When last member leaves the group, user is not prompted with a warning message #42204

Closed

Description

@lanitochka17

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.74
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4566310
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home

  2. Tap start chat

  3. Select a user and create group

  4. Send few messages

  5. Tap header -- member

  6. Select one member listed and remove the member

  7. Tap back

  8. Tap Leave group

Expected Result:

When last member leaves the group, user must be prompted with a warning message

Actual Result:

When last member leaves the group, user is not prompted with a warning message

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

Bug6481922_1715795982090.group.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0108d139f0fc936c57
  • Upwork Job ID: 1790901683068096512
  • Last Price Increase: 2024-05-16
  • Automatic offers:
    • tienifr | Contributor | 0
Issue OwnerCurrent Issue Owner: @greg-schroeder

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 15, 2024
  2. melvin-bot commented on May 15, 2024

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (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.

  3. lanitochka17 commented on May 15, 2024

    @lanitochka17
    Author

    @greg-schroeder 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

  4. lanitochka17 commented on May 15, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp

  5. cretadn22 commented on May 15, 2024

    @cretadn22
    Contributor

    Proposal

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

    When the final member leaves from the group, the user won't receive a warning message

    To see this bug clearly, we can do these steps:

    1. Create a group (1 admin, 1 member)
    2. Go offline
    3. Delete the member
    4. Leave group

    What is the root cause of that problem?

    The issue arises because when removing the member, we only add the "pending" field and remain report.participant, but
    we solely rely on report.participant to determine if it's the last member

    if (Object.keys(report?.participants ?? {}).length === 1) {

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

    We must ensure that we don't include members with pending deletion actions when verifying if they are the last member

    if (Object.keys(report?.participants ?? {}).length - pendingChatMembers.length === 1 ) {
    

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  6. ZhenjaHorbach commented on May 15, 2024

    @ZhenjaHorbach
    Contributor

    Actually we have a ticket where we need to refactor Details page and move leave button to menu items
    #40256

    So I think it's better to fix this issue it there since this button will be moved to ReportDetails

    And to fix this issue

    Proposal

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

    mWeb - Members - When last member leaves the group, user is not prompted with a warning message

    What is the root cause of that problem?

    The main problem with issue is that when we remove member it remains in report?.participants but with pending action equal to delete

    if (Object.keys(report?.participants ?? {}).length === 1) {

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

    To fix this issue we can use activeChatMembers

    const activeChatMembers = participants.flatMap((accountID) => {
    const pendingMember = report?.pendingChatMembers?.findLast((member) => member.accountID === accountID.toString());
    return !pendingMember || pendingMember.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? accountID : [];
    });

    instead report?.participants

    if (Object.keys(report?.participants ?? {}).length === 1) {

    What alternative solutions did you explore? (Optional)

    NA

  7. greg-schroeder commented on May 16, 2024

    @greg-schroeder
    Contributor

    Checking if we should handle here before applying External

  8. greg-schroeder commented on May 16, 2024

    @greg-schroeder
    Contributor

    Looks like they want to solve this separately, so let's keep it here. Going to add External

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 16, 2024
  10. melvin-bot commented on May 16, 2024

    @melvin-bot
  11. changed the title [-]mWeb - Members - When last member leaves the group, user is not prompted with a warning message[/-] [+][$250] mWeb - Members - When last member leaves the group, user is not prompted with a warning message[/+] on May 16, 2024
  12. 22 remaining items

  13. changed the title [-][$250] mWeb - Members - When last member leaves the group, user is not prompted with a warning message[/-] [+][HOLD for payment 2024-06-13] [$250] mWeb - Members - When last member leaves the group, user is not prompted with a warning message[/+] on Jun 6, 2024
  14. melvin-bot commented on Jun 6, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Jun 6, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.79-11 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 2024-06-13. 🎊

    For reference, here are some details about the assignees on this issue:

  16. melvin-bot commented on Jun 6, 2024

    @melvin-bot

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
    • [@mananjadhav] 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:
    • [@mananjadhav] A discussion in #expensify-bugs 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:
    • [@mananjadhav] Determine if we should create a regression test for this bug.
    • [@mananjadhav] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  17. mananjadhav commented on Jun 11, 2024

    @mananjadhav
    Collaborator

    I couldn't pinpoint to the exact PR for this one, but I feel we should add a regression test for this one. The test steps from the PR looks fine to me.

    1. Open app
    2. Tap start chat
    3. Select a user and create group
    4. Send few messages
    5. Tap header -- member
    6. Select one member listed and remove the member
    7. Tap back
    8. Tap Leave group
    9. When last member leaves the group, user must be prompted with a warning message.
  18. greg-schroeder commented on Jun 13, 2024

    @greg-schroeder
    Contributor

    Processing

  19. greg-schroeder commented on Jun 13, 2024

    @greg-schroeder
    Contributor

    Payment summary:

    Contributor: @tienifr - $250 - Paid via Upwork
    C+: @mananjadhav - $250 - You can make a manual request

  20. greg-schroeder commented on Jun 13, 2024

    @greg-schroeder
    Contributor

    Regression test filed, closing

  21. JmillsExpensify commented on Jun 14, 2024

    @JmillsExpensify
    Contributor

    $250 approved for @mananjadhav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions