Skip to content
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

Adding and removing group members #746

Merged
merged 17 commits into from
May 16, 2024

Conversation

neekolas
Copy link
Contributor

@neekolas neekolas commented May 16, 2024

tl;dr

  • Adds support for adding and removing group members using GroupMembership
  • Makes add_missing_members work with the new membership primitives

Next up

  • I stripped out group.members() from this PR. Will be updating that next

@@ -144,93 +141,6 @@ impl From<Vec<Vec<u8>>> for AddressesOrInstallationIds {
}
}

#[derive(Debug, Clone)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding and removing members are now handled in a single action. That way we can bundle up adding missing installations with adding a new member, as a single commit.

@neekolas neekolas requested review from richardhuaaa, insipx and 37ng May 16, 2024 15:19
// get current number of users in group
let member_count = self.members()?.len();
if member_count + account_addresses.len() > MAX_GROUP_SIZE as usize {
if member_count + inbox_id_map.len() > MAX_GROUP_SIZE as usize {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could multiple addresses in account_addresses link to the same inbox id so that we over-calculate the group size?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only until we update group.members() to be based on inbox ID. Coming very soon

xmtp_mls/src/groups/sync.rs Outdated Show resolved Hide resolved
@neekolas neekolas marked this pull request as ready for review May 16, 2024 21:54
@neekolas neekolas requested a review from a team as a code owner May 16, 2024 21:54
@neekolas neekolas merged commit 6a6e6da into identity-release May 16, 2024
6 checks passed
@neekolas neekolas deleted the nm/add-remove-group-members branch May 16, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants