-
Notifications
You must be signed in to change notification settings - Fork 325
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
Use MLS member table indexed by group id #2859
Conversation
15704bd
to
5f562b9
Compare
87a11d6
to
2c1c036
Compare
7a89f33
to
e2f47c8
Compare
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.
Looks good! There are some questions I have though; see them inlined. In particular, if possible it'd be great to avoid conditional execution of various MLS actions if we're in a function that deals with MLS conversations only.
for_ (Data.mlsMetadata (tUnqualified lconv')) $ \meta -> | ||
traverse_ (removeUser lconv' (cnvmlsGroupId meta)) victims |
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.
You said the SConversationLeaveTag
case applies to MLS only, hence this protocol-constrained removal is fine?
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.
No, the removeUser
function is from the MLS modules. It only applies to MLS conversations, that's why it's okay to require the MLS metadata as argument
let curEpoch = cnvmlsEpoch mlsMeta | ||
groupId = cnvmlsGroupId mlsMeta | ||
suite = cnvmlsCipherSuite mlsMeta |
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.
This now allows to drop the Member (ErrorS 'ConvNotFound) r
constraint from this function: it is not thrown directly here anymore, nor applyProposalRef
needs to throw it because it does have all the MLS metadata needed.
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.
I could remove the ConvNotFound
constraint from checkEpoch
, but checkGroup
still throws it. I refactored both functions to not used the converation object anymore but rather the ConversationMLSData
in
8e92789
ProposalAction -> | ||
Maybe UpdatePath -> | ||
Sem r () | ||
processExternalCommit qusr mSenderClient lconv cm epoch groupId action updatePath = withCommitLock groupId epoch $ do | ||
processExternalCommit qusr mSenderClient lconv mlsMeta cm epoch action updatePath = withCommitLock (cnvmlsGroupId mlsMeta) epoch $ do |
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.
The ConvNotFound
error constraint likely isn't needed here either.
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.
Unfortunately because of checkGroup
it can't be removed
ProposalAction -> | ||
Sender 'MLSPlainText -> | ||
Commit -> | ||
Sem r [LocalConversationUpdate] | ||
processCommitWithAction qusr senderClient con lconv cm epoch groupId action sender commit = | ||
processCommitWithAction qusr senderClient con lconv mlsMeta cm epoch action sender commit = |
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.
Can you check if ConvNotFound
can be removed from this one too?
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.
Unfortunately it can't because of downstream checkGroup
.
@@ -110,9 +110,10 @@ removeClient :: | |||
ClientId -> | |||
Sem r () | |||
removeClient lc qusr cid = do |
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.
Can you see if you can change the signature of the function such that you don't need to do for_
in the function? You know you do this only for MLS clients, so it feels a bit awkward to have to check if this is an MLS conversation.
I think you could pass in ConversationMLSData
and as little as needed from Local Data.Conversation
instead of passing in the whole 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.
Downstream of removeClient
is propagateMessage
and runMessagePush
which require the full conversation object. Maybe we could refactor them as well, but I woudn't want to mix it into this PR
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.
Fair point about inlining the for_
part into removeUser
itself. Did this is acf5d67bb0fc9e61753e927bb8f7751377a33c26
e2f47c8
to
8e92789
Compare
acf5d67
to
d9b8425
Compare
This PR adds a table
galley.mls_group_member_client
(indexed by group id) which replacesgalley.member_client
(index by conv). Motivation: This table may be used by MLS subconversations. This PR also includes a data migration fromgalley.member_client
togalley.mls_group_member_client
(tested locally).Checklist
changelog.d