Skip to content

[$250] [MEDIUM] [Groups] - Group chat with one user is allowed in confirmation page, but not in contact list #39317

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.58-4
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Start chat
  3. Click Add to group with one user
  4. Click Create chat
  5. Note that user lands on 1:1 DM
  6. Go to FAB > Start chat
  7. Select Add to group with the same user in Step 3 and another user
  8. Click Next
  9. In confirmation page, unselect the other user and click Start group

Expected Result:

If app allows to create a group with just one user, Step 3 should result in the creation of a new group

Actual Result:

n Step 3, app does not allow the creation of group chat with one user when clicking Add to group with just one user in contact list.
However, in Step 7, when user selects two users in contact list and unselects one user in confirmation page, app allows to create group chat in one user

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

Bug6432392_1711780022164.20240330_142048.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01dea4375c99aa51fe
  • Upwork Job ID: 1775972935262842880
  • Last Price Increase: 2024-04-04
Issue OwnerCurrent Issue Owner: @s77rt

Activity

  1. melvin-bot commented on Mar 30, 2024

    @melvin-bot

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

  2. github-actions commented on Mar 30, 2024

    @github-actions
    Contributor

    👋 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.
  3. lanitochka17 commented on Mar 30, 2024

    @lanitochka17
    Author

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

  4. lanitochka17 commented on Mar 30, 2024

    @lanitochka17
    Author

    @puneetlath 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

  5. gijoe0295 commented on Mar 30, 2024

    @gijoe0295
    Contributor

    Proposal

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

    Can create a group chat with one user in confirmation page.

    What is the root cause of that problem?

    In NewChatConfirmationPage, the condition to show Create group button is incorrect:

    showConfirmButton={selectedOptions.length > 1}

    selectedOptions in this page also includes the group creator.

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

    We have several approaches for this:

    1. Change the condition in RCA to selectedOptions.length > 2.
    2. Disable selection if the selected options list has less than or equal 3 (i.e. the group creator and 2 other members) here. By this, user cannot remove any member from the list when there are only 2 other members. The isDisabled condition will be isAdmin || selectedOptions.length <= 2.
    3. Show an error message when press Create group if the group size is not enough. To do this, we should create an error state variable and inside createGroup function here, we check if selectedOptions.length <= 2 to set the appropriate error message. We then use DotIndicatorMessage to display that error.
    Screenshot 2024-03-31 at 00 17 30

    What alternative solutions did you explore? (Optional)

    NA

  6. ShridharGoel commented on Mar 30, 2024

    @ShridharGoel
    Contributor

    Proposal

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

    Allow users to create group chats with only 1 other user + with 0 other users.

    What is the root cause of that problem?

    Kind of a new feature.

    The current behaviour checks for selectedOptions.length > 1

    confirmButtonText={selectedOptions.length > 1 ? translate('common.next') : translate('newChatPage.createChat')}

    onConfirmSelection is also dependent on selectedOptions

    onConfirmSelection={selectedOptions.length > 1 ? navigateToConfirmPage : createChat}

    In NewChatConfirmPage, confirm button is shown only if selectedOption length is > 1.

    showConfirmButton={selectedOptions.length > 1}

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

    In BaseOptionsSelector, add a new prop called shouldShowConfirmButtonWithoutSelection.

    This will be passed as true from NewChatPage, which will lead to showing the footer button even if nothing is selected.

    New condition for shouldShowFooter:

    const shouldShowFooter =
            !this.props.isReadOnly && (this.props.shouldShowConfirmButton || this.props.footerContent) && (!(this.props.canSelectMultipleOptions && _.isEmpty(this.props.selectedOptions)) || shouldShowConfirmButtonWithoutSelection);
    

    We'll update the confirm text:

    confirmButtonText={selectedOptions.length > 0 ? translate('common.next') : 'Proceed with only yourself'} // Add it in en.ts and es.ts and use translate
    

    onConfirmSelection will also need an update, we don't want to check for selectedOptions.length > 1 now,

    onConfirmSelection={navigateToConfirmPage}
    

    In NewChatConfirmPage, we'll change the showConfirmButton logic so that the button shows even if there's only the creator of the group present.

    showConfirmButton={selectedOptions.length > 0}
    
    Screen.Recording.2024-04-04.at.1.12.50.PM.mov
  7. allgandalf commented on Apr 1, 2024

    @allgandalf
    Contributor

    Proposal

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

    We allow user user to create group chat with just 2 users

    What is the root cause of that problem?

    Currently, we allow the user to unselect the participants of the group without checking the number of selected participants:

    const unselectOption = (option: ListItem) => {
    if (!newGroupDraft) {
    return;
    }
    const newSelectedParticipants = newGroupDraft.participants.filter((participant) => participant.login !== option.login);
    Report.setGroupDraft(newSelectedParticipants);
    };

    But in the main contact page, if you check the video, we will not allow the user to create a group, we will take them to 1:1 DM.

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

    So here as per the design, i think it's best to disable deselecting participants if the length is 3:

    onst unselectOption = (option: ListItem) => {
            if (!newGroupDraft || selectedOptions.length <= 3) {
                return;
            }
            const newSelectedParticipants = newGroupDraft.participants.filter((participant) => participant.login !== option.login);
            Report.setGroupDraft(newSelectedParticipants);
        };
        

    This way we maintain the group screen also allowing the user to unselect users if the length is more than 3.

    We can also show a error message at the bottom stating that you cannot create a group of less than 3 members, if you want to add more members then go back to the contact page and add more participants.

    What alternative solutions did you explore? (Optional)

    N/A

  8. 59 remaining items

  9. abzokhattab commented on Jul 9, 2024

    @abzokhattab
    Contributor

    thank u applied

  10. mvtglobally commented on Jul 19, 2024

    @mvtglobally

    Issue not reproducible during KI retests. (Fifth week)

  11. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Jul 22, 2024
  12. mallenexpensify commented on Jul 22, 2024

    @mallenexpensify
    Contributor

    Contributor: @abzokhattab paid $250 via Upwork
    Contributor+: @s77rt paid $250 via Upwork.

    @s77rt plz complete the BZ checklist below? Thx

    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:

    • [@] The PR that introduced the bug has been identified. Link to the PR:
    • [@] 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:
    • [@] 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:
    • [@] Determine if we should create a regression test for this bug.
    • [@] 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.
    • [@bz] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  13. s77rt commented on Jul 22, 2024

    @s77rt
    Member
  14. s77rt commented on Jul 22, 2024

    @s77rt
    Member
  15. mallenexpensify commented on Jul 22, 2024

    @mallenexpensify
    Contributor

    Thanks @s77rt , closing

  16. melvin-bot commented on Oct 8, 2024

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

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 productionDailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsNewFeatureSomething to build that is a new item.Not a priority

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions