Adds conversation_type to MlsGroup struct in favor of reading group metadata state for conversation_type#2249
Merged
cameronvoell merged 8 commits intomainfrom Jul 25, 2025
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
richardhuaaa
approved these changes
Jul 24, 2025
7727f5a to
2dd66f6
Compare
…up_state_for_conv_type
cameronvoell
commented
Jul 25, 2025
| self.0.clone(), | ||
| msg.group_id.clone(), | ||
| None, | ||
| ConversationType::Group, |
Contributor
Author
There was a problem hiding this comment.
This is the one place the new conversation type needs to be added where we dont know its value. I think we're also populating dummy data for dm id here and the code path looks like conversation_type is not used, so I think this is safe for now, but seems like a code smell.
nplasterer
pushed a commit
that referenced
this pull request
Jul 25, 2025
…etadata state for conversation_type (#2249) retrieving from group state metadata The `MlsGroup` struct now stores `conversation_type` as a direct field rather than retrieving it asynchronously from metadata. The `conversation_type()` method changes from an async method that queries metadata to a synchronous method that returns the stored field. All `MlsGroup` creation methods across the codebase are updated to accept and pass the `conversation_type` parameter. The `FfiConversation.conversation_type()` method in [bindings_ffi/src/mls.rs](https://github.com/xmtp/libxmtp/pull/2249/files#diff-3a24c3e76565487a710ac9863ac05160128f4f90892e07849b555a6de43a6e8f) becomes synchronous and directly returns the stored value. A new `get_conversation_type()` method is added to the `QueryGroup` trait in [xmtp_db/src/encrypted_store/group.rs](https://github.com/xmtp/libxmtp/pull/2249/files#diff-e3d4940853a1045db514d5c1a48581d9ef53da4ba45a7cb8387c72c99c475b5a) to retrieve conversation types directly from the database. Start with the `MlsGroup` struct definition and its `conversation_type()` method in [xmtp_mls/src/groups/mod.rs](https://github.com/xmtp/libxmtp/pull/2249/files#diff-c29f56a38916c7410eff8091df1a2e43487ffe20646d96827e846e475f4608d3) to understand how the conversation type field is now stored and accessed. - Added conversation_type parameter to MlsGroup constructor call [0c65c4a] - Changed conversation type parameter in MlsGroup initialization during message recovery [ee2d364] ---- _[Macroscope](https://app.macroscope.com) summarized ee2d364._ --------- Co-authored-by: cameronvoell <cameronvoell@users.noreply.github.com>
nplasterer
added a commit
that referenced
this pull request
Jul 25, 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.

See iOS repro test PR this was tested against for performance:
xmtp/xmtp-ios#542
got this three times in a row on my repro before this libxmtp update:
and then after libxmtp update conversations.list() never hit the high max again:
Store conversation type as field in MlsGroup struct instead of retrieving from group state metadata
The
MlsGroupstruct now storesconversation_typeas a direct field rather than retrieving it asynchronously from metadata. Theconversation_type()method changes from an async method that queries metadata to a synchronous method that returns the stored field. AllMlsGroupcreation methods across the codebase are updated to accept and pass theconversation_typeparameter. TheFfiConversation.conversation_type()method in bindings_ffi/src/mls.rs becomes synchronous and directly returns the stored value. A newget_conversation_type()method is added to theQueryGrouptrait in xmtp_db/src/encrypted_store/group.rs to retrieve conversation types directly from the database.📍Where to Start
Start with the
MlsGroupstruct definition and itsconversation_type()method in xmtp_mls/src/groups/mod.rs to understand how the conversation type field is now stored and accessed.Changes since #2249 opened
Macroscope summarized ee2d364.