Skip to content

Conversation

@battermann
Copy link
Contributor

@battermann battermann commented Nov 5, 2025

https://wearezeta.atlassian.net/browse/WPB-20429

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@battermann battermann marked this pull request as ready for review November 5, 2025 12:28
@battermann battermann requested review from a team as code owners November 5, 2025 12:28
@battermann battermann requested a review from Copilot November 5, 2025 12:28
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Nov 5, 2025
Copy link
Contributor

Copilot AI left a 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 UserGroupStore effect to Galley's effect stack to enable querying user groups associated with conversations
  • Modified replaceMembers function 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.

@battermann battermann force-pushed the battermann/replace-users-in-conv branch from 30d1f6f to b2bf6cb Compare November 5, 2025 12:36
@battermann battermann force-pushed the battermann/replace-users-in-conv branch from ae0bb92 to a1d1424 Compare November 6, 2025 14:05
@battermann battermann merged commit 34d2a0c into develop Nov 6, 2025
9 checks passed
@battermann battermann deleted the battermann/replace-users-in-conv branch November 6, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants