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

Chat - Users that are not members of the room are suggested when type "@" #24436

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 11, 2023 · 53 comments
Closed
1 of 6 tasks
Assignees
Labels
NewFeature Something to build that is a new item. Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 11, 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!


Action Performed:

  1. Navigate to a group chat or #Room that has several members (>6)
  2. Enter "@" in the compose box
  3. Observe the list of user suggestions

Expected Result:

5 suggestions should be shown at once inside the mention menu that are members of the room. As more characters are typed, if member of the room contains those characters, they'll always show at top. Any suggestions after/below that can use our existing search logic (because it's intended to be able to mention anyone in a room, we just want to prioritize showing members first)

Actual Result:

Users that are not members of the room are suggested when type "@"

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • Windows / Chrome
  • MacOS / Desktop

Version Number: 1.3.53.1

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6161416_Recording__679.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0106156f4c26122cd1
  • Upwork Job ID: 1720587630725419008
  • Last Price Increase: 2023-11-03
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 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

@samh-nl
Copy link
Contributor

samh-nl commented Aug 11, 2023

Proposal

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

Users that are not members of the room are suggested when type "@"

What is the root cause of that problem?

The mention suggestions are generated in getMentionOptions. It does not take into account whether the report is a room, and if so, return only the room participants.

/**
* Build the suggestions for mentions
* @param {Object} personalDetails
* @param {String} [searchValue]
* @returns {Object}
*/
getMentionOptions(personalDetails, searchValue = '') {

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

We should update getMentionOptions:

  1. Check if the report is a room
  2. If so, limit the scope to only the participants, instead of all known personal details

We could consider implementing similar functionality for other report types.

What alternative solutions did you explore? (Optional)

Alternatively, we could put the participants at the top of the list, but still include other users.

@spcheema
Copy link
Contributor

Similar root cause #22596 (comment)

It was decided to close since it's not a bug @mallenexpensify

@melvin-bot melvin-bot bot added the Overdue label Aug 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

@mallenexpensify Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

@mallenexpensify 10 days overdue. Is anyone even seeing these? Hello?

@mallenexpensify mallenexpensify added NewFeature Something to build that is a new item. Weekly KSv2 and removed Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Aug 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

Current assignee @mallenexpensify is eligible for the NewFeature assigner, not assigning anyone new.

@melvin-bot melvin-bot bot removed the Overdue label Aug 23, 2023
@mallenexpensify
Copy link
Contributor

Thanks @spcheema for the link!
I'm swapping this from a bug to a feature request and making it a weekly to review again down the line. From a logic point of view, it makes sense that the first people shown in a restricted group would be those in the group.

@spcheema
Copy link
Contributor

Yeah sure, thank @mallenexpensify

Please keep in your thoughts I was the first one purpose the same solution :)

@melvin-bot melvin-bot bot added the Overdue label Sep 1, 2023
@mallenexpensify
Copy link
Contributor

I'm OOO this week, will review next week once back

@melvin-bot melvin-bot bot removed the Overdue label Sep 5, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 13, 2023
@mallenexpensify
Copy link
Contributor

Dropped in #expensify-open-source
https://expensify.slack.com/archives/C01GTK53T8Q/p1695117107964409

Applause reported the above, I updated it from Bug to New Feature. I'd like to move the issue folder since it makes sense to me to that the members of a room should show first in the recommendations (this happens to me a lot in a private room, when I try to tag @drew the top three recommendations are Andrew and none are members of the room)
If anyone has any feedback or context on how we display our recommendations (and if this can be External) can you please comment on the issue or in 🧵 ? (also if you don't agree we implement the new feature, or to not do it now)

@melvin-bot melvin-bot bot removed the Overdue label Sep 19, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 27, 2023
@mallenexpensify
Copy link
Contributor

Will look into when I have time

@melvin-bot melvin-bot bot removed the Overdue label Oct 4, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 13, 2023
@mallenexpensify
Copy link
Contributor

Need to prioritize soon as I think it's a useful feature request

@melvin-bot melvin-bot bot removed the Overdue label Oct 14, 2023
@melvin-bot melvin-bot bot added the Overdue label Mar 12, 2024
@youssef-lr
Copy link
Contributor

@mallenexpensify have you figured out where this fits and its priority?

@melvin-bot melvin-bot bot removed the Overdue label Mar 12, 2024
@mallenexpensify
Copy link
Contributor

Good question @youssef-lr , thanks for the ping, I haven't slotted feature requests to project yet.
Pinged Tom in #wave-collect to see if that's best, it feels like it is cuz I feel like VSBs would mainly have employees on their account and not a bunch of others. ¯_(ツ)_/¯

@mallenexpensify
Copy link
Contributor

Added to #vip-vsb since it doesn't involve money. It's a feature request so it might not get addressed soon.
@youssef-lr reported similar functionality for group chats today too, here

@paultsimura
Copy link
Contributor

paultsimura commented Mar 22, 2024

Proposal

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

Chat members are not displayed first in the mention suggestions list

What is the root cause of that problem?

This is a feature request. We do not consider the chat members while sorting the mention suggestions:

const sortedPersonalDetails = lodashSortBy(filteredPersonalDetails, (detail) => detail?.displayName || detail?.login);

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

First, we should pass the reportID prop down from Composer to the SuggestionMention component.

Then, we should get the list of the report members (pseudo-code, we should use memo by reportID):

const report = ReportUtils.getReport(reportID);
const visibleMemberIDs = ReportUtils.getVisibleMemberIDs(report);

Finally, use this visibleMemberIDs list when building the sortedPersonalDetails to place them first in the list:

const sortedPersonalDetails = lodashSortBy(filteredPersonalDetails, (detail) =>
    // Sorting first by being a member, and then – by title
    [!visibleMemberIDs.includes(detail?.accountID ?? 0), detail?.displayName || detail?.login],
);

const sortedPersonalDetails = lodashSortBy(filteredPersonalDetails, (detail) => detail?.displayName || detail?.login);

Result (works for rooms and chats):

Screen.Recording.2024-03-22.at.20.52.2620.53.mp4

What alternative solutions did you explore? (Optional)

@mallenexpensify
Copy link
Contributor

@cubuspl42 @youssef-lr , do you think this feature request can be addressed one-off or should we get more 👀 in #expensify-open-source to make sure any changes that would be made, wouldn't conflict with anything else?

@cubuspl42
Copy link
Contributor

Looking at the recent proposal, the solution doesn't seem to be very invasive. I'd say we can address this one-off.

@spcheema
Copy link
Contributor

@mallenexpensify @cubuspl42 it's pretty straight forward to restrict non-members being tagged in a room/workspace.

I have submitted RCA & solution here while back

#22596 (comment)

It can be done externally since it requires no backend change.

Hi @mallenexpensify @cubuspl42

I did submitted proposal long ago but then issues decided not to proceed with.

If we are going ahead then I'll update proposal accordingly.

@melvin-bot melvin-bot bot added the Overdue label Apr 1, 2024
@mallenexpensify mallenexpensify added Weekly KSv2 and removed Daily KSv2 labels Apr 3, 2024
@melvin-bot melvin-bot bot removed the Overdue label Apr 3, 2024
@mallenexpensify
Copy link
Contributor

Bumping to weekly while we await prioritization and/or a holistic plan.

@twisterdotcom
Copy link
Contributor

I totally think we should do this. Reported it herem as well: https://expensify.slack.com/archives/C049HHMV9SM/p1712147101614789

@melvin-bot melvin-bot bot added the Overdue label Apr 11, 2024
@mallenexpensify
Copy link
Contributor

Checking on here

@mallenexpensify
Copy link
Contributor

no action on the above, Will revisit soon.

@melvin-bot melvin-bot bot removed the Overdue label May 7, 2024
@melvin-bot melvin-bot bot added the Overdue label May 16, 2024
@mallenexpensify
Copy link
Contributor

@melvin-bot melvin-bot bot removed the Overdue label May 20, 2024
@mallenexpensify
Copy link
Contributor

Going to close for now, since I think/hope we'll be addressing this more holistically soon, as part of Search v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NewFeature Something to build that is a new item. Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

8 participants