Skip to content

[HOLD for payment 2024-04-25] [$250] Group chat - User can proceed without Start group button via CMD+Enter shortcut #39323

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. Select two users
  4. Click Next
  5. Unselect all the users
  6. Press CMD+Enter

Expected Result:

User will not be able to proceed with CMD+Enter

Actual Result:

User is able to proceed with CMD+Enter when there is no Start group button

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

Bug6432490_1711793679354.20240330_180951.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013017903b692fbc8f
  • Upwork Job ID: 1774843147497160704
  • Last Price Increase: 2024-04-01
  • Automatic offers:
    • jjcoffee | Reviewer | 0
Issue OwnerCurrent Issue Owner: @anmurali

Activity

  1. added
    DeployBlockerCash
    on Mar 30, 2024
  2. melvin-bot commented on Mar 30, 2024

    @melvin-bot

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

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

    @lanitochka17
    Author

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

    @lanitochka17
    Author

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

  6. ShridharGoel commented on Mar 30, 2024

    @ShridharGoel
    Contributor

    Proposal

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

    User can proceed without Start group button via CMD+Enter shortcut

    What is the root cause of that problem?

    There's no check for minimum number of participants in createGroup method. We are removing the confirm button but shortcut can still be used to continue.

    const createGroup = () => {
    if (!newGroupDraft) {
    return;
    }
    const logins: string[] = newGroupDraft.participants.map((participant) => participant.login);
    Report.navigateToAndOpenReport(logins, true, groupName);
    };

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

    Add the below check to ensure there are at least 2 users (though it's not technically a group with 2 users, it's a DM which is going to be handled by this proposal).

    const createGroup = () => {
            if (!newGroupDraft || newGroupDraft.participants.length <= 1) {
                return;
            }
            const logins: string[] = newGroupDraft.participants.map((participant) => participant.login);
            Report.navigateToAndOpenReport(logins, true, groupName);
        };
    

    The above code is tested.

  7. abzokhattab commented on Mar 30, 2024

    @abzokhattab
    Contributor

    Proposal

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

    user can create a group chat when with no users when clicking on CMD+ENTER

    What is the root cause of that problem?

    The issue occurs because, within the SelectionList, the CMD+ENTER keyboard shortcut remains active even when the Confirm button is not displayed.

    useKeyboardShortcut(
    CONST.KEYBOARD_SHORTCUTS.CTRL_ENTER,
    (e) => {
    const focusedOption = flattenedSections.allOptions[focusedIndex];
    if (onConfirm) {
    onConfirm(e, focusedOption);
    return;
    }
    selectFocusedOption();
    },
    {
    captureOnInputs: true,
    shouldBubble: !flattenedSections.allOptions[focusedIndex],
    isActive: !disableKeyboardShortcuts && isFocused,
    },
    );

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

    To resolve this inconsistency, we should align keyboard actions with the UI's state by deactivating the keyboard shortcut when the Confirm button is hidden.

    • This can be achieved by adding && showConfirmButton to the condition above, ensuring that the confirmation action is triggered only when the Confirm button is visible:
                if (onConfirm && showConfirmButton) {

    or

        if (onConfirm) {
            if (!showConfirmButton) {
                return;
            }
            onConfirm(e, focusedOption);
            return;
        }

    alternatively:

    • Alternatively, we can change the isActive condition to ensure it is only true when both onConfirm and showConfirmButton are either true or false simultaneously:
                isActive: !disableKeyboardShortcuts && isFocused && !!showConfirmButton === !!onConfirm,
  8. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Apr 1, 2024
  9. blimpich commented on Apr 1, 2024

    @blimpich
    Contributor

    this probably due to the new group chats PR #37458. Not big enough of an issue to revert, so lets just open this to contributors.

  10. added
    External
    on Apr 1, 2024
  11. 28 remaining items

  12. added
    Awaiting Payment
    on Apr 18, 2024
  13. changed the title [-][$250] Group chat - User can proceed without Start group button via CMD+Enter shortcut[/-] [+][HOLD for payment 2024-04-25] [$250] Group chat - User can proceed without Start group button via CMD+Enter shortcut[/+] on Apr 18, 2024
  14. removed
    Reviewing
    on Apr 18, 2024
  15. melvin-bot commented on Apr 18, 2024

    @melvin-bot

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

  16. melvin-bot commented on Apr 18, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.62-17 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-04-25. 🎊

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

  17. melvin-bot commented on Apr 18, 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:

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

    @anmurali

    Not due for another couple of days but @nkdengineer - you can accept the offer here.

  19. added
    Daily
    and removed
    Weekly
    on Apr 24, 2024
  20. jjcoffee commented on Apr 26, 2024

    @jjcoffee
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: Create Group Chats + Splits. #37458
    • 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: https://github.com/Expensify/App/pull/37458/files#r1581099685
    • 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: N/A
    • Determine if we should create a regression test for this bug. Yes
    • 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.

    Regression Test Proposal

    1. Go to FAB > Start chat
    2. Select any two users
    3. Click Next
    4. Unselect all the users
    5. Press CMD+Enter and verify that you cannot proceed

    Do we agree 👍 or 👎

  21. melvin-bot commented on Apr 29, 2024

    @melvin-bot

    @bondydaa, @anmurali, @jjcoffee, @nkdengineer Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  22. anmurali commented on Apr 30, 2024

    @anmurali

    Paid, added regression test.

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions