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

fix: map and ignore BufferedFutureMessage #2084

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ actual fun mapMLSException(exception: Exception): MLSFailure =
when (exception.error) {
is CryptoError.WrongEpoch -> MLSFailure.WrongEpoch
is CryptoError.DuplicateMessage -> MLSFailure.DuplicateMessage
is CryptoError.BufferedFutureMessage -> MLSFailure.BufferedFutureMessage
is CryptoError.SelfCommitIgnored -> MLSFailure.SelfCommitIgnored
is CryptoError.UnmergedPendingGroup -> MLSFailure.UnmergedPendingGroup
is CryptoError.ConversationAlreadyExists -> MLSFailure.ConversationAlreadyExists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ interface MLSFailure : CoreFailure {

object DuplicateMessage : MLSFailure

object BufferedFutureMessage : MLSFailure

object SelfCommitIgnored : MLSFailure

object UnmergedPendingGroup : MLSFailure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ sealed class MLSMessageFailureResolution {
internal object MLSMessageFailureHandler {
fun handleFailure(failure: CoreFailure): MLSMessageFailureResolution {
return when (failure) {
// Received messages targeting a future epoch, we might have lost messages.
// Received messages targeting a future epoch (outside epoch bounds), we might have lost messages.
is MLSFailure.WrongEpoch -> MLSMessageFailureResolution.OutOfSync
// Received already sent or received message, can safely be ignored.
is MLSFailure.DuplicateMessage -> MLSMessageFailureResolution.Ignore
// Received self commit, any unmerged group has know when merged by CoreCrypto.
// Received message was targeting a future epoch and been buffered, can safely be ignored.
is MLSFailure.BufferedFutureMessage -> MLSMessageFailureResolution.Ignore
// Received self commit, any unmerged group has know been when merged by CoreCrypto.
is MLSFailure.SelfCommitIgnored -> MLSMessageFailureResolution.Ignore
// Message arrive in an unmerged group, it has been buffered and will be consumed later.
is MLSFailure.UnmergedPendingGroup -> MLSMessageFailureResolution.Ignore
Expand Down
Loading