-
Notifications
You must be signed in to change notification settings - Fork 15
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
refactor: process conversation proteus/MLS message add event - WPB-10174 #2164
base: develop
Are you sure you want to change the base?
refactor: process conversation proteus/MLS message add event - WPB-10174 #2164
Conversation
/// The decrypted current message + decrypted buffered messages | ||
/// along with the related sender client ID for each message. | ||
|
||
public var decryptedMessages: [DecryptedMessage] = [] |
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.
similar to the Proteus add event with the message content property, this property will be filled in the decryptor when the message + buffered messages are decrypted
) | ||
|
||
var decryptedEvent = eventData | ||
decryptedEvent.decryptedMessages = decryptedMessages |
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.
filled here
) | ||
|
||
do { | ||
let decryptedEventData = try await mlsMessageDecryptor.decryptedEventData(from: eventData) |
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.
similar to what we did for the proteusMessageAdd, we use the decryptor to decrypt the MLS messages from the event and return the same event filled with the decrypted messages (current one and buffered ones)
} | ||
|
||
// swiftlint:disable:next todo_requires_jira_link | ||
// TODO: Move to UserClientsLocalStore when related PR is merged |
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 related PR
) | ||
} | ||
|
||
func testAddProteusMessage_It_Adds_Message_To_Conversation() async throws { |
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.
testing a regular message is added to conversation
) | ||
} | ||
|
||
func testAddProteusMessage_It_Adds_Big_Payload_Message_To_Conversation() async throws { |
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.
testing a large message payload (external) is added to the conversation
@@ -46,7 +46,7 @@ extension ZMClientMessage: CompositeMessageData { | |||
|
|||
// MARK: - ButtonStates Interface | |||
extension ZMClientMessage { | |||
static func updateButtonStates(withConfirmation confirmation: ButtonActionConfirmation, | |||
public static func updateButtonStates(withConfirmation confirmation: ButtonActionConfirmation, |
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.
some methods were made public to facilitate the work in this PR, many others had to be factored out because they could not be reused (the ones that take a ZMUpdateEvent as parameter)
WireLogger.mls.error( | ||
"failed to add mls message: conversation not found in db" | ||
) |
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.
if we throw I guess we can remove logging the error
return results | ||
|
||
} catch { | ||
WireLogger.mls.warn( |
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.
WireLogger.mls.warn( | |
WireLogger.mls.error( |
WPB-10174
Key points
This PR is part of the quick sync refactoring plan and is related to processing the multiple events we receive from the backend or the push channel.
Specifically, this PR is about porting the existing implementation of the
ConversationMLSMessageAdd
and theConversationProteusMessageAdd
event.A previous PR was opened and is now closed since this PR contains both implementation (Proteus and MLS) - related tickets:
Testing
addMessage
for MLS/Proteus methods are correctly invoked.Checklist
[WPB-XXX]
.