-
Notifications
You must be signed in to change notification settings - Fork 292
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
feat: mls migration #15247
feat: mls migration #15247
Conversation
2eff161
to
a8a237e
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## dev #15247 +/- ##
==========================================
+ Coverage 45.18% 45.21% +0.03%
==========================================
Files 708 718 +10
Lines 23354 23537 +183
Branches 5330 5355 +25
==========================================
+ Hits 10553 10643 +90
- Misses 11451 11538 +87
- Partials 1350 1356 +6 |
ccb3f91
to
bef3ad3
Compare
a5d7d1e
to
76fd401
Compare
c232748
to
b94f079
Compare
b7fed06
to
75dfe1b
Compare
* feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types
* feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: initialise migration of proteus conversations * feat: create mls group after switching to mixed and add other clients * runfix: send messages with mls if conversation is actually mls (not if group id exists) * chore: bump core * refactor: don't replace conversation's reference * feat: insert system message after conversation protocol update * refactor: improve reaction to protocol update event * refactor: move protocol update logic to conversation repository * feat: save conversation state to db after updating protocol * feat: update conversation protocol-related fields after protocol was updated * refactor: move adding users of conversation to separate module * refactor: move establishing group for mixed conversation to separate module * chore: update comments * runfix: don't try to to add users to mls group if mixed conv is empty * test: adding all conversation members to mls group * test: try establishing mls group for mixed conversation * chore: remove comment * test: conversation repo updateConversationProtocol * test: initialise migration of proteus conversations * refactor: CR suggestions
* feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: initialise migration of proteus conversations * feat: create mls group after switching to mixed and add other clients * feat: periodically check migration config [FS-1893] (#15117) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * runfix: send messages with mls if conversation is actually mls (not if group id exists) * chore: bump core * refactor: don't replace conversation's reference * feat: insert system message after conversation protocol update * refactor: improve reaction to protocol update event * refactor: move protocol update logic to conversation repository * feat: save conversation state to db after updating protocol * feat: update conversation protocol-related fields after protocol was updated * refactor: move adding users of conversation to separate module * refactor: move establishing group for mixed conversation to separate module * chore: update comments * runfix: don't try to to add users to mls group if mixed conv is empty * test: adding all conversation members to mls group * test: try establishing mls group for mixed conversation * chore: remove comment * test: conversation repo updateConversationProtocol * test: initialise migration of proteus conversations * refactor: CR suggestions * feat: join unestablished mixed conversations * test: join unestablished mixed conversations * feat: periodically check migration config [FS-1893] (#15117) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: start migration of proteus conversations [FS-1888] (#15198) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: initialise migration of proteus conversations * feat: create mls group after switching to mixed and add other clients * runfix: send messages with mls if conversation is actually mls (not if group id exists) * chore: bump core * refactor: don't replace conversation's reference * feat: insert system message after conversation protocol update * refactor: improve reaction to protocol update event * refactor: move protocol update logic to conversation repository * feat: save conversation state to db after updating protocol * feat: update conversation protocol-related fields after protocol was updated * refactor: move adding users of conversation to separate module * refactor: move establishing group for mixed conversation to separate module * chore: update comments * runfix: don't try to to add users to mls group if mixed conv is empty * test: adding all conversation members to mls group * test: try establishing mls group for mixed conversation * chore: remove comment * test: conversation repo updateConversationProtocol * test: initialise migration of proteus conversations * refactor: CR suggestions * chore: improve logs in add users method * chore: bump core
* feat: wipe mls group if user is removed / leave mls-capable conversation * feat: add users to mls group when conversation is mixed * feat: restart periodic key material timers on app reload * test: adding users to mls/mixed/proteus group * test: add users to mls group * runfix: joining mls capable conversations * test: remove / leave conversation * runfix: add users to mixed conversation * runfix: show unestablished mixed conversations * refactor: test * refactor: apply cr suggestion * refactor: add MLSCapableConversation type
* feat: periodically check migration config [FS-1893] (#15117) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: start migration of proteus conversations [FS-1888] (#15198) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: initialise migration of proteus conversations * feat: create mls group after switching to mixed and add other clients * runfix: send messages with mls if conversation is actually mls (not if group id exists) * chore: bump core * refactor: don't replace conversation's reference * feat: insert system message after conversation protocol update * refactor: improve reaction to protocol update event * refactor: move protocol update logic to conversation repository * feat: save conversation state to db after updating protocol * feat: update conversation protocol-related fields after protocol was updated * refactor: move adding users of conversation to separate module * refactor: move establishing group for mixed conversation to separate module * chore: update comments * runfix: don't try to to add users to mls group if mixed conv is empty * test: adding all conversation members to mls group * test: try establishing mls group for mixed conversation * chore: remove comment * test: conversation repo updateConversationProtocol * test: initialise migration of proteus conversations * refactor: CR suggestions * feat: automatically join mixed conversations [FS-1897] (#15248) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: initialise migration of proteus conversations * feat: create mls group after switching to mixed and add other clients * feat: periodically check migration config [FS-1893] (#15117) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * runfix: send messages with mls if conversation is actually mls (not if group id exists) * chore: bump core * refactor: don't replace conversation's reference * feat: insert system message after conversation protocol update * refactor: improve reaction to protocol update event * refactor: move protocol update logic to conversation repository * feat: save conversation state to db after updating protocol * feat: update conversation protocol-related fields after protocol was updated * refactor: move adding users of conversation to separate module * refactor: move establishing group for mixed conversation to separate module * chore: update comments * runfix: don't try to to add users to mls group if mixed conv is empty * test: adding all conversation members to mls group * test: try establishing mls group for mixed conversation * chore: remove comment * test: conversation repo updateConversationProtocol * test: initialise migration of proteus conversations * refactor: CR suggestions * feat: join unestablished mixed conversations * test: join unestablished mixed conversations * feat: periodically check migration config [FS-1893] (#15117) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: start migration of proteus conversations [FS-1888] (#15198) * feat: base for initialisation and finalisation methods * feat: check if migration time has arrived after mls is supported * refactor: improve init migration api * refactor: rename func * refactor: move initialisation and finalisation to separate modules * runfix: start migration flow in background after app was initialised * feat: filter unestablished mls conversations out * feat: filter out only mls conversations that are unestablished * refactor: move mls migration logger to separate file * feat: update conversation locally * chore: remove migration init code (follow-up pr) * refactor: resolve core and api client in module * feat: read feature config from teamstate * chore: update core * runfix: check fresh migration config when timer elapses * chore: update comment * refactor: use reduce for grouping conversations by protocol * refactor: simplify removal key check * feat: update core with new migration config types * refactor: improve types * feat: initialise migration of proteus conversations * feat: create mls group after switching to mixed and add other clients * runfix: send messages with mls if conversation is actually mls (not if group id exists) * chore: bump core * refactor: don't replace conversation's reference * feat: insert system message after conversation protocol update * refactor: improve reaction to protocol update event * refactor: move protocol update logic to conversation repository * feat: save conversation state to db after updating protocol * feat: update conversation protocol-related fields after protocol was updated * refactor: move adding users of conversation to separate module * refactor: move establishing group for mixed conversation to separate module * chore: update comments * runfix: don't try to to add users to mls group if mixed conv is empty * test: adding all conversation members to mls group * test: try establishing mls group for mixed conversation * chore: remove comment * test: conversation repo updateConversationProtocol * test: initialise migration of proteus conversations * refactor: CR suggestions * chore: improve logs in add users method * chore: bump core * runfix: filter duplicated system messages (#15264) * feat: maintain mls group list during migration [WPB-1115] (#15318) * feat: wipe mls group if user is removed / leave mls-capable conversation * feat: add users to mls group when conversation is mixed * feat: restart periodic key material timers on app reload * test: adding users to mls/mixed/proteus group * test: add users to mls group * runfix: joining mls capable conversations * test: remove / leave conversation * runfix: add users to mixed conversation * runfix: show unestablished mixed conversations * refactor: test * refactor: apply cr suggestion * refactor: add MLSCapableConversation type * test: fix test * chore: bump core with draft-20 corecrypto * chore: bump core * feat: debug util to update migration feature team settings config * feat: add qa debug util for displaying epoch info * refactor: reuse existing functionality of joining mls conv with ext commit * runfix: welcome message not being sent in self conversation anymore * feat: add supportedProtocols field on user entity * chore: bump core to beta
src/script/components/MessagesList/Message/ProtocolUpdateMessage/ProtocolUpdateMessage.tsx
Show resolved
Hide resolved
{message.caption && ( | ||
<span className="system-message-caption ellipsis" dangerouslySetInnerHTML={{__html: message.caption}} /> | ||
)} |
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.
out of scope: This is probably not for this PR, but in the future, we should try to move this caption for the entity
to the react component
layer and render it a pure React node (not innerHTML
)
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.
Noted, will think about that 👌
/** | ||
* Get all the group conversations owned by self user's team from the local state. | ||
*/ | ||
public readonly getAllSelfTeamOwnedGroupConversations = (): 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.
suggestion: the name seems a little long. How about a small simplification?
public readonly getAllSelfTeamOwnedGroupConversations = (): Conversation[] => { | |
public readonly getAllTeamGroupConversations = (): Conversation[] => { |
case ClientEvent.CONVERSATION.JOINED_AFTER_MLS_MIGRATION_FINALISATION: | ||
case ClientEvent.CONVERSATION.MLS_MIGRATION_FINALISATION_ONGOING_CALL: |
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.
suggestion: I feel the FINALISATION
here is kind of redundant. WDYT?
case ClientEvent.CONVERSATION.JOINED_AFTER_MLS_MIGRATION_FINALISATION: | |
case ClientEvent.CONVERSATION.MLS_MIGRATION_FINALISATION_ONGOING_CALL: | |
case ClientEvent.CONVERSATION.JOINED_AFTER_MLS_MIGRATION: | |
case ClientEvent.CONVERSATION.MLS_MIGRATION_ONGOING_CALL: |
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.
Makes sense 👍
const sendOptions: Parameters<typeof conversationService.send>[0] = isMLSConversation(conversation) | ||
? { | ||
groupId, | ||
groupId: conversation.groupId, |
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.
👍
.table(StorageSchemata.OBJECT_STORE.CONVERSATIONS) | ||
.toCollection() | ||
.modify((conversation: ConversationRecord) => { | ||
conversation.initial_protocol = conversation.protocol; |
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.
good catch 👌
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.
LGTM.
Quick word of advice: in general we should name files/directory as nouns, not actions.
Instead of finaliseMigration
it should be migrationFinalizer
.
Feature branch for MLS migration feature, for more details see subpages of https://wearezeta.atlassian.net/wiki/spaces/CORE/pages/746488003/Proteus+to+MLS+Migration