-
Notifications
You must be signed in to change notification settings - Fork 334
WPB-20429 Replace the members of a channels (for TM) #4838
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
Conversation
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.
Pull Request Overview
This PR extends the PUT /conversations/:domain/:conv_id/members endpoint to support user groups. When replacing members in a conversation (specifically channels), the implementation now ensures that members added via user groups are preserved and not removed during the replace operation.
Key Changes
- Added
UserGroupStoreeffect to Galley's effect stack to enable querying user groups associated with conversations - Modified
replaceMembersfunction to fetch user groups for a conversation and merge their members with invited users - Updated the member removal logic to handle channels with non-member admins appropriately
- Added integration test demonstrating the feature with user groups
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| services/galley/src/Galley/Effects.hs | Added UserGroupStore to Galley's effect stack |
| services/galley/src/Galley/App.hs | Integrated Postgres interpreter for UserGroupStore |
| services/galley/src/Galley/API/Update.hs | Modified replaceMembers to preserve user group members and handle channel removal logic |
| services/galley/galley.cabal | Added vector dependency |
| services/galley/default.nix | Added vector dependency |
| libs/wire-subsystems/src/Wire/UserGroupStore.hs | Added GetUserGroupsForConv operation |
| libs/wire-subsystems/src/Wire/UserGroupStore/Postgres.hs | Implemented getUserGroupsForConv with SQL query |
| libs/wire-subsystems/test/unit/Wire/MockInterpreters/UserGroupStore.hs | Added mock implementation for getUserGroupsForConv |
| integration/test/Test/Channels.hs | Added integration test for member replacement with user groups |
| changelog.d/2-features/WPB-20429 | Updated changelog with PR reference |
Comments suppressed due to low confidence (1)
services/galley/src/Galley/API/Update.hs:1124
- The comment says 'Add members first', but the actual order is: additions first (line 1124-1129), then removals (line 1131-1142). This is confusing as the function documentation at line 1057 says 'executing removals followed by additions'. The comment should be corrected to match the actual implementation order.
-- Add members first
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
30d1f6f to
b2bf6cb
Compare
ae0bb92 to
a1d1424
Compare
https://wearezeta.atlassian.net/browse/WPB-20429
Checklist
changelog.d