-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Conversation
🦋 Changeset detectedLatest commit: 22bd817 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #31525 +/- ##
===========================================
- Coverage 59.38% 59.38% -0.01%
===========================================
Files 2547 2547
Lines 63238 63227 -11
Branches 14224 14217 -7
===========================================
- Hits 37557 37546 -11
Misses 22974 22974
Partials 2707 2707
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 <[email protected]>
Signed-off-by: Abhinav Kumar <[email protected]>
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
Signed-off-by: Abhinav Kumar <[email protected]>
Signed-off-by: Abhinav Kumar <[email protected]>
Signed-off-by: Abhinav Kumar <[email protected]>
ee18257
apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useAddUserAction.tsx
Show resolved
Hide resolved
…ove/threadMetrics * 'develop' of github.com:RocketChat/Rocket.Chat: (49 commits) feat: add `sidepanelNavigation` to Feature preview list (#33156) refactor: Realtime Monitoring Counters to TS (#33182) fix: restore tooltips to units Multiselect (#33174) test: Add unit test for RoomMenu options (#32891) chore: remove notifyListener call that was causing startup issues (#33154) fix: Multi-step modals closing unexpectedly (#33158) Revert "refactor: Realtime Monitoring Counters to TS" (#33170) refactor: Realtime Monitoring Counters to TS (#33166) refactor: Uses `source` instead of `room` to render the `OmnichannelRoomIcon` (#33118) refactor: Realtime Monitoring Overviews to TS (#33167) test: Add e2e tests for teams multi-step modals (#33168) feat: add Advanced settings accordion to `EditRoomInfo` (#33114) chore: Revive Livechat Storybook (#33137) refactor: Realtime `Doughnout Charts` to TS (#33092) feat: create contact endpoint (#32693) chore: remove left streaming code (#33039) fix: show only relevant userInfoActions for mentioned non-members (#31525) feat: Setting for enabling files encryption and fix whitelist media types stopping E2EE uploads (#33003) refactor: Replace proxy functions from `LivechatTyped` class with direct calls (#33110) Revert "fix: Inconsistent Markdown Formatting in Custom Status Field" (#33127) ...
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.