-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
fix: show only relevant userInfoActions for mentioned non-members #31525
base: develop
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: fdad230 The changes in this PR will be included in the next version bump. This PR includes changesets to release 34 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #31525 +/- ##
========================================
Coverage 56.76% 56.76%
========================================
Files 2496 2495 -1
Lines 55358 55364 +6
Branches 11455 11457 +2
========================================
+ Hits 31423 31428 +5
+ Misses 21241 21237 -4
- Partials 2694 2699 +5
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we not use subscription.getOne endpoint instead?
Hey @debdutdeb, sorry for delayed reply. |
Right. But I don't think you need all these endpoints. Membership is a subscription. So one endpoint should be sufficient, like |
|
also idk if client caches the memberlist, might be a good idea to utilize if it does. |
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Thanks for the input @debdutdeb. I did not know about subscriptions earlier. |
This was my initial approach, but the member list functionality does a search and receives a paginated result. So there is no guarantee that the required username would be present in the result or not. |
apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useAddUserAction.tsx
Show resolved
Hide resolved
apps/meteor/client/views/room/hooks/useUserInfoActions/useUserInfoActions.ts
Outdated
Show resolved
Hide resolved
apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useAddUserAction.tsx
Outdated
Show resolved
Hide resolved
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
dc0eb25
to
5c383ec
Compare
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
29facd0
to
b68f6ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please fix the conflicts too?
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
…mention-user-membership-check
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Proposed changes (including videos or screenshots)
This pull request addresses an issue in the user mention functionality within Rocket.Chat channels. Previously, when a user mentioned another user who was not a member of the channel, the User Info card still displayed options like 'Remove User', 'Set as Leader', 'Set as Moderator', etc., which were not applicable for non-members. This fix introduces a check to determine if the mentioned user is a member of the channel/group. If the user is not a member, it now shows an option to 'Add User' to the channel and omits inappropriate options for non-members.
add-user-2024-01-24_17.28.08.mp4
Issue(s)
When a user mentions another user who was not a member of the channel, the User Info card still displays options like 'Remove User', 'Set as Leader', 'Set as Moderator', etc., which are not applicable for non-members
Also
Fixes #31712
Steps to test or reproduce
Further comments
TC-1079
Justification for New Endpoint
room.isMember
We considered using
channels.members/groups.members
with filters for membership checks but faced issues:LIMIT_PER_PAGE
, the target user might not appear on the first page, requiring extra API calls.To ensure precise and efficient user membership verification, we introduced the
room.isMember
endpoint, circumventing the limitations of existing endpoints and ensuring a more reliable and performant solution.