-
Notifications
You must be signed in to change notification settings - Fork 14
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
Group Chat Streaming #166
Group Chat Streaming #166
Conversation
This reverts commit 8998d13.
…into np/group-conversations
This reverts commit 76bfcc7.
…roup-streaming
fun streamDecryptedMessages(): Flow<DecryptedMessage> = callbackFlow { | ||
val messageCallback = object : FfiMessageCallback { | ||
override fun onMessage(message: FfiMessage) { | ||
trySend(decrypt(Message(client, message))) |
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 think we want to refer to what you're doing in here as decoding rather than decrypting. The messages all get decrypted in libxmtp
.
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.
So we have two streaming methods one for decoding and one for decrypting. We need this stream decrypted messages for React Native custom content types. @nakajima could speak more to it.
Since Groups are conforming to the current Conversation model I have to use these methods. Once we do the refactor to Groups Dms and Conversation parent we might be able to get rid of some of these things.
But to break as little of the existing flow as possible. This is 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.
What is the intended difference between a DecryptedMessage
and a DecodedMessage
? When I trace the method calls from both streaming methods, they seem to produce the same result (they both return something with a field called encodedContent
that is set to EncodedContent.parseFrom(libXMTPMessage.content)
)
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 don't think there is going to be any difference in the V3 world but again I didn't follow as closely to the reasoning for custom contentTypes. I found this for context xmtp/xmtp-ios#196
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.
Have a question in the PR but accepting to unblock React Native, well done on the persistence and fast turnaround! Did you manage to get both streams working simultaneously?
fun streamDecryptedMessages(): Flow<DecryptedMessage> = callbackFlow { | ||
val messageCallback = object : FfiMessageCallback { | ||
override fun onMessage(message: FfiMessage) { | ||
trySend(decrypt(Message(client, message))) |
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.
What is the intended difference between a DecryptedMessage
and a DecodedMessage
? When I trace the method calls from both streaming methods, they seem to produce the same result (they both return something with a field called encodedContent
that is set to EncodedContent.parseFrom(libXMTPMessage.content)
)
This adds the streaming components of group chat