-
Notifications
You must be signed in to change notification settings - Fork 6
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: fetch group id on protocol change event WPB-4336 #2051
Merged
typfel
merged 1 commit into
epic/mls-migration
from
fix/fetch-group-id-on-protocol-change
Sep 14, 2023
Merged
fix: fetch group id on protocol change event WPB-4336 #2051
typfel
merged 1 commit into
epic/mls-migration
from
fix/fetch-group-id-on-protocol-change
Sep 14, 2023
Conversation
This file contains 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
github-actions
bot
added
🚨 Potential breaking changes
type: bug / fix 🐞
👕 size: L
labels
Sep 12, 2023
Datadog ReportAll test runs ✅ 2 Total Test Services: 0 Failed, 0 with New Flaky, 2 Passed Test Services
|
vitorhugods
approved these changes
Sep 14, 2023
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.
👨🏼🍳🤌🏻
yamilmedina
approved these changes
Sep 14, 2023
@@ -1200,7 +1200,7 @@ class UserSessionScope internal constructor( | |||
|
|||
private val protocolUpdateEventHandler: ProtocolUpdateEventHandler | |||
get() = ProtocolUpdateEventHandlerImpl( | |||
conversationDAO = userStorage.database.conversationDAO, | |||
conversationRepository = conversationRepository, |
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.
Like it, no direct DAO access :D
typfel
added a commit
that referenced
this pull request
Sep 19, 2023
typfel
added a commit
that referenced
this pull request
Sep 19, 2023
typfel
added a commit
that referenced
this pull request
Sep 26, 2023
typfel
added a commit
that referenced
this pull request
Oct 4, 2023
typfel
added a commit
that referenced
this pull request
Oct 4, 2023
typfel
added a commit
that referenced
this pull request
Oct 6, 2023
typfel
added a commit
that referenced
this pull request
Oct 10, 2023
typfel
added a commit
that referenced
this pull request
Oct 11, 2023
typfel
added a commit
that referenced
this pull request
Oct 13, 2023
typfel
added a commit
that referenced
this pull request
Oct 13, 2023
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 15, 2023
* feat(mls-migration): fetch migration configuration every 24 hours #1 (#1728) * feat(mls-migration): migrate proteus conversations to "mixed" protocol #2 (#1729) * feat: add api support for updating the conversation protocol * fix: rollback when we lost the race to establish a MLS group * feat: add method for migrating from proteus to mixed * feat: allow controlling migration update interval in CLI * fix: use correct use case for checking if we can register an MLS client * chore: add debug response since BE is not implemented yet * test: add test for aborting when losing the race to establish an mls group * test: add network test for updating protocol * test: add MLSMigrationManager tests * test: add MLSMigrator tests * chore: fix detekt * chore: make method private * refactor: add sql query for fetching proteus team conversations * feat(mls-migration): support the mixed protocol #3 (#1747) * feat(mls-migration): supported protocols for users #4 (#1786) * feat: add API support for supported-protocols * feat: support persisting supported protocols * feat: add mapping of supported protocols in logic module * chore: fix detekt * refactor: rename UserProtocol to SupportedProtocolDTO * chore: move BaseApi interface to its own file * chore: fix imports after rebase * fix: persist supported protocols locally when API request succeeds * chore: remove debug line * fix: mapsupported protocols when fetching one-to-one conversationd details * refactor: move default value for supportedProtocols to the logic mapping layer * feat(mls-migration): add use case for updating self supported protocols #5 (#1797) * feat: add use case for calculating & updating your supported protocols * test: add UpdateSupportedProtocolsUseCase tests * refactor: simplify UpdateSupportedProtocolsUseCase * test: update feature config test data * chore: add mlsPublicKeys to NewClientDTO * feat: persist if a self client is mls capable or not * feat: update supported protocols from user.update events * fix: migration (altering column positions not supported) * chore: clean up disabled migration configuration * feat(mls-migration): update conversation protocol to MLS when every member supports MLS #6 (#1802) * feat: support fetching conversation which can be finalised * feat: add function for finalising migration of team group conversations * refactor: move methods for updating conversation protocol to the conversation repository * chore: fix copy & paste error * refactor: don't return a flow when fetching conversations for migration * chore: rebase clean up * performance: replace string matching by listing all cases * feat(mls-migration): handle protocol changed events #7 (#1811) * feat: support persisting protocol changed system messages * feat: process protocol change events and insert system messages * feat: insert history lost system message if protocol change is discovered during slow sync * chore: add migration of new system message table * fix: check if protocol was updated inside sql query * fix: only fetch group conversations by protocol * chore: document return value * chore: fix test naming * refactor: rename SystemMessageBuilder to SystemMessageInserter * chore: fix logging inconsistency * fix: import * chore: fix compilation * fix(mls-migration): migration feature config #8 (#1822) * fix: mls migration config fields are all optional * chore: update tests after removing no longer necessary fields * chore: fix detekt * feat(mls-migration): update self supported protocols during slow sync (#1826) #9 * feat(mls-migration): force migration when migration deadline arrives #10 (#1831) * feat: end migration regardless when migration deadline arrives * refactor: generalise methods for fetching conversations ids * refactor: better naming * feat(mls-migration): ignore inactive clients when calculating supported protocols #11 (#1904) * test: add test cases for ignoring inactive clients when calculating supported protocols * feat: add isActive computed property on Client model * feat: ignore inactive clients when checking if all self clients are mls capable * fix: updating isMLSCapable (#1905) * fix: updating isMLSCapable It should be possible to update isMlsCapable from false to true but not the other way around. * chore: add comment explaining update logic for is_mls_capable * chore: fix detekt * fix: fetch group id on protocol change event (#2051) * chore: fix rebase issues * feat(mls-one2one): support fetching mls 1-1 conversation details (#1848) * feat: support fetching mls 1-1 conversation details * refactor: better naming of function * chore: remove another magic number * feat: support migrating to mls 1-1 (#1875) * refactor: allow fetching whole conversations by a member (#1940) * feat(mls): establish one-to-one conversation [WPB-2258] (#1953) * feat(mls): migrate 1:1 connections from Proteus to MLS [WPB-2258] (#1968) * feat: choose 1:1 protocol [WPB-2181] (#1993) Co-authored-by: Mojtaba Chenani <[email protected]> * feat: check supported protocols when creating/fetching team 1-1 (#1995) * feat: establish mls 1-1 for team members if mls is the default protocol * refactor: update GetOrCreateOneToOneConversationUseCaseTest to use the arrangement pattern * test: update with test cases covering mls as the default protocol * feat: support persisting the default protocol from mls feature config * test: update & add tests for persisting the default protocol * chore: EstablishMLSOneToOneUseCase was renamed into MLSOneOnOneConversationResolver * test: don't expect team 1-1 to be established * fix: use protocol selector for deciding which protocol use for team 1-1 * chore: fix detekt * feat: active one-on-one conversations (#2010) * feat(persistance): active/inactive one-on-one conversations * fix: more efficient mapping Co-authored-by: Mojtaba Chenani <[email protected]> * refactor: join with Conversation table instead Co-authored-by: Mojtaba Chenani <[email protected]> * refactor: rename oneOnOneConversationId to activeOneOnOneconversationId Co-authored-by: Vitor Hugo Schwaab <[email protected]> --------- Co-authored-by: Mojtaba Chenani <[email protected]> Co-authored-by: Vitor Hugo Schwaab <[email protected]> * feat: resolve one-on-one conversation to either proteus or mls (#2012) * chore: default selfUser when creator field is missing (#2022) * feat: resolve one-on-one conversaions when receiving a welcome message (#2033) * feat: resolve one-on-on conversation when the connection is accepted (#2034) * feat: resolve active 1-1 after accepting a connection request (#2042) * feat: support parsing quantum safe ciphersuite (#2049) * feat: avoid race condition when establishing mls 1-1 (#2048) * feat: add live property to Event model Distinguish between live events arriving via the websocket vs events fetched when catching up when connectivity is restored. * feat: delay resolving active one-on-one when live Delay resolving active one-on-one when a connection request is accepted and we are live. This avoids a race to establish the mls group when multiple clients are online, which is wasteful. * chore: update tests after adding live propperty * chore: fix detekt * fix: always schedule resolving active 1-1 to avoid discarding welcome msg * fix: improve stability of MLS 1-1 conversations (#2063) * fix: don't fail migration query if messages has already been copied * fix: don't fail the slow sync on a non-recoverable error when resolving 1-1s * fix: don't fail the slow sync when etablishing 1-1 fails due to missing key packages * fix: re-use existing mls group if it exists * fix: establish 1-1 also with other self clients * test: add missing test for establishing 1-1 * chore: fix detekt * feat: limit re-trying commit to 2 retry attemps (#2068) * feat: limit re-trying commit to 2 retry attemps * refactor: rename retryCount to remainingAttempts for better readability * chore: fix rebase issues * fix: map and ignore BufferedFutureMessage (#2084) * feat: update supported protocols after deleting a client (#2083) * feat(mls): recover from stale epoch on message sending (#2076) * feat: parse epoch timestamp in conversation response * feat: persist epoch timestamp * feat: verify if we have lost commits when sending fails * test: add tests for stale epoch handler * fix: don't compare against last processed event instead use time heuristic * fix: verify epoch using CC in WrongEpochHandler * refactor: replace MLSWrongEpochHandler with StaleEpochVerifier since they are identical * fix: fail re-try if verifying epoch fails * Revert "feat: persist epoch timestamp" This reverts commit e968af6. * Revert "feat: parse epoch timestamp in conversation response" This reverts commit f1bf8b4. * chore: remove any remaining trace of epochTimestamp * chore: fix rebase issues * feat(debug): add use case for disabling event processing (#2096) * chore: fix rebase issues * refactor: mls feature config handling (#2114) * refactor: mls feature config handling * chore: remove debug println * chore: use named arguments for better readability * refactor: extract handlers into variables and re-use them * fix: assign supported_protocols when migration user db (#2126) * chore(mls): propagate activeOneOnOneConversation on ConversationDetails [WPB-4705] (#2130) * refactor: only have one main query for inserting/updating users (#2124) * refactor: only have one main query for inserting/updating users * fix: incorrect user mapping for team member * chore: inline function which is only used once * fix: updating connection status * fix: user type not updating for non-team contacts * fix: typo in partial user update query * chore: update tests after rebase * fix: supported protocols is only available since API v5 (#2128) * fix: skip updating supported protocols when mls is not supported (#2131) * chore: fix rebase issues * chore: squash migrations when possible --------- Co-authored-by: Vitor Hugo Schwaab <[email protected]> Co-authored-by: Mojtaba Chenani <[email protected]>
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.
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
After someone else has migrated a conversation proteus to
mls
messages fail to decrypt.Causes
When a conversation is migrated to mls this will result in a
conversation.protocol
update event informing everyone that the conversation is now using a different protocol. We were correctly processing this event and updating the protocol field of the conversation but we didn't fetch & persist the group ID which a conversation gets assign when migrates tomixed
ormls
.On processing an incoming message in the migrated conversation we would fail to lookup the groupID which is necessary in order to decrypt the message, instead the whole operation fails and we present it as a decryption error to the user.
Solutions
Fetch group ID in addition to persisting the new protocol.
This is slightly tricky because we want to do this as an atomic operation which can be retried in case of network failure.
Testing
Test Coverage
PR Post Submission Checklist for internal contributors (Optional)
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.