WPB-20429 Replace the members of a channels (for TM)#4838
Merged
battermann merged 8 commits intodevelopfrom Nov 6, 2025
Merged
WPB-20429 Replace the members of a channels (for TM)#4838battermann merged 8 commits intodevelopfrom
battermann merged 8 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
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
akshaymankar
reviewed
Nov 5, 2025
akshaymankar
approved these changes
Nov 6, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ae0bb92 to
a1d1424
Compare
This was referenced Nov 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://wearezeta.atlassian.net/browse/WPB-20429
Checklist
changelog.d