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] Start chat-Removed newly selected participants from search results in group chat flow #29971

Closed
6 tasks done
lanitochka17 opened this issue Oct 19, 2023 · 15 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. DeployBlockerCash This issue or pull request should block deployment 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 Hourly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 19, 2023

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.3.87-1

Reproducible in staging?: Yes

Reproducible in production?: No

If this was caught during regression testing, add the test name, ID and link from TestRail:

Email or phone of affected tester (no customers):

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

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

Issue found when executing PR #29903

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in with any Gmail account
  3. From the FAB Start chat
  4. On the participants selector, add a couple participants to the group Start searching for a user and verify the selected participants are gone
  5. Search for a user that you have selected

Expected Result:

The newly selected participants show up in the search results

Actual Result:

Removed the newly selected participants from the search results in the group chat flow

Workaround:

Unknown

Platforms:

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

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

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
Windows: Chrome
Bug6242914_1697719005687.The_newly_added_group_member_is_not_show_up_in_the_search_results.mp4
MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0134c731261cf5cd20
  • Upwork Job ID: 1715033894384357376
  • Last Price Increase: 2023-10-19
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@OSBotify
Copy link
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.

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

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

@flodnv
Copy link
Contributor

flodnv commented Oct 19, 2023

I'm unable to reproduce 😕 Are you able to @conorpendergrast ?

Screen.Recording.2023-10-19.at.11.52.24.AM.mov

@flodnv flodnv added the External Added to denote the issue can be worked on by a contributor label Oct 19, 2023
@melvin-bot melvin-bot bot changed the title Start chat-Removed newly selected participants from search results in group chat flow [$500] Start chat-Removed newly selected participants from search results in group chat flow Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

Job added to Upwork: https://www.upwork.com/jobs/~0134c731261cf5cd20

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 19, 2023
@flodnv
Copy link
Contributor

flodnv commented Oct 19, 2023

Going to see if anyone External is able to reproduce this...

@melvin-bot
Copy link

melvin-bot bot commented Oct 19, 2023

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

@flodnv
Copy link
Contributor

flodnv commented Oct 19, 2023

@abdulrahuman5196 are you able to reproduce?

@yakupafsin
Copy link
Contributor

@abdulrahuman5196 are you able to reproduce?

When you search the user who is not in your contacts and toggle it, it's not showing on the list when you search again.

@abdulrahuman5196
Copy link
Contributor

abdulrahuman5196 commented Oct 19, 2023

@flodnv . This was changed recently to show only the selected participants matching the search term recently. If the participants don't match the search term it won't be visible.

Cc: @thienlnam

@yakupafsin
Copy link
Contributor

I almost fixed that. I'll open the proposal soon

@abdulrahuman5196
Copy link
Contributor

@flodnv @lanitochka17 I am confused with the steps provided.
I feel like this issue is similar to this - #29917

Like when new user is selected it disappears from the list

@yakupafsin
Copy link
Contributor

Proposal

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

The issue we are trying to address is related to the behavior when searching for users to add to a chat. When a user is not in our contacts list and is selected, they disappear from the search results. Even if we search for them again, they do not appear in the search list.

What is the root cause of that problem?

This problem occurs because the new user is not returned in the getFilteredOptions function when they are selected. Consequently, they do not appear in the search results.

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

To solve this issue, we should implement a function that checks whether the user we are searching for is already in the selected user list. If the user is in the list, they should be displayed in the search results. The code to be added is as follows:

const isOptionInList = _.some(selectedOptions, (selectedOption) => selectedOption.login === searchTerm);
        if (isOptionInList) {
            sectionsList.push({
                title: undefined,
                data: [_.find(selectedOptions, (selectedOption) => selectedOption.login === searchTerm)],
                shouldShow: !_.isEmpty(selectedOptions),
                indexOffset,
            });
            indexOffset += selectedOptions.length;
        }

This code should be integrated into the 'sections' section of the code, which can be found here:

const sections = useMemo(() => {

With these changes, even if the user we are searching for is not in our contacts list, they will remain in the search results until we delete the search text.

What alternative solutions did you explore? (Optional)

An alternative solution would be to remove the following code block:

// Only show the selected participants if the search is empty
if (searchTerm === '') {
sectionsList.push({
title: undefined,
data: selectedOptions,
shouldShow: !_.isEmpty(selectedOptions),
indexOffset,
});
indexOffset += selectedOptions.length;
}

However, implementing this alternative solution would cause issues in the long term, as all users previously added to the chat would reappear in the search results, making it difficult to search for new users.

@thienlnam
Copy link
Contributor

This is a dupe of this bug report #29917
Going to close and consolidate the efforts there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. DeployBlockerCash This issue or pull request should block deployment 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 Hourly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants