Skip to content

Commit

Permalink
feat: parse supported protocols (#15379)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
PatrykBuniX authored Jun 21, 2023
1 parent 14156ea commit af7529c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"@emotion/react": "11.11.1",
"@types/eslint": "8.37.0",
"@wireapp/avs": "9.2.15",
"@wireapp/core": "40.5.3-draft-20-cc.0",
"@wireapp/core": "40.5.5-draft-20-cc.0",
"@wireapp/lru-cache": "3.8.1",
"@wireapp/react-ui-kit": "9.7.5",
"@wireapp/store-engine-dexie": "2.1.1",
Expand Down
8 changes: 7 additions & 1 deletion src/script/conversation/ConversationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ import {ConversationFilter} from './ConversationFilter';
import {ConversationLabelRepository} from './ConversationLabelRepository';
import {ConversationDatabaseData, ConversationMapper} from './ConversationMapper';
import {ConversationRoleRepository} from './ConversationRoleRepository';
import {isMLSCapableConversation, isMLSConversation} from './ConversationSelectors';
import {
isMixedConversation,
isMLSCapableConversation,
isMLSConversation,
isProteusConversation,
MLSCapableConversation,
} from './ConversationSelectors';
import {ConversationService} from './ConversationService';
import {ConversationState} from './ConversationState';
import {ConversationStateHandler} from './ConversationStateHandler';
Expand Down
2 changes: 1 addition & 1 deletion src/script/conversation/ConversationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {container} from 'tsyringe';

import {getLogger, Logger} from 'Util/Logger';

import {MLSCapableConversation, MLSConversation} from './ConversationSelectors';
import {MLSCapableConversation} from './ConversationSelectors';

import type {Conversation as ConversationEntity} from '../entity/Conversation';
import type {EventService} from '../event/EventService';
Expand Down
4 changes: 4 additions & 0 deletions src/script/entity/User/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*
*/

import {ConversationProtocol} from '@wireapp/api-client/lib/conversation';
import {QualifiedId} from '@wireapp/api-client/lib/user';
import {amplify} from 'amplify';
import ko from 'knockout';
Expand Down Expand Up @@ -98,6 +99,7 @@ export class User {
/** The federated domain (when the user is on a federated server) */
public domain: string;
public readonly isBlockedLegalHold: ko.PureComputed<boolean>;
public readonly supportedProtocols: ko.ObservableArray<ConversationProtocol>;

static get ACCENT_COLOR() {
return {
Expand Down Expand Up @@ -147,6 +149,8 @@ export class User {

this.name = ko.observable('');

this.supportedProtocols = ko.observableArray<ConversationProtocol>([]);

this.managedBy = ko.observable(User.CONFIG.MANAGED_BY.WIRE);

this.initials = ko.pureComputed(() => {
Expand Down
5 changes: 5 additions & 0 deletions src/script/user/UserMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export class UserMapper {
picture,
service,
team: teamId,
supported_protocols: supportedProtocols,
} = userData;

if (accentId) {
Expand Down Expand Up @@ -141,6 +142,10 @@ export class UserMapper {
userEntity.managedBy(managedBy);
}

if (supportedProtocols) {
userEntity.supportedProtocols(supportedProtocols);
}

if (expirationDate) {
userEntity.isTemporaryGuest(true);
const setAdjustedTimestamp = () => {
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6138,9 +6138,9 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/api-client@npm:^24.15.6-draft-20-cc.0":
version: 24.15.6-draft-20-cc.0
resolution: "@wireapp/api-client@npm:24.15.6-draft-20-cc.0"
"@wireapp/api-client@npm:^24.15.7-draft-20-cc.0":
version: 24.15.7-draft-20-cc.0
resolution: "@wireapp/api-client@npm:24.15.7-draft-20-cc.0"
dependencies:
"@wireapp/commons": ^5.1.0
"@wireapp/priority-queue": ^2.1.1
Expand All @@ -6153,7 +6153,7 @@ __metadata:
spark-md5: 3.0.2
tough-cookie: 4.1.3
ws: 8.11.0
checksum: 4cbc6e9faae364e17aca8982a7e8f39fd0165d89fed7c4bcad2df2a42310c39f890aa826f29cc00fad9f4957feef77c0f67ed563279281322f981aaebb652570
checksum: 45972dcdcfe8775eb0f52420767083be9e0f72d3838565a7567f824282da9ec6c3be8954564d52fa1cba582023ed0cb48255e8750e9b8918e27f06d571ccf526
languageName: node
linkType: hard

Expand Down Expand Up @@ -6206,11 +6206,11 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/core@npm:40.5.3-draft-20-cc.0":
version: 40.5.3-draft-20-cc.0
resolution: "@wireapp/core@npm:40.5.3-draft-20-cc.0"
"@wireapp/core@npm:40.5.5-draft-20-cc.0":
version: 40.5.5-draft-20-cc.0
resolution: "@wireapp/core@npm:40.5.5-draft-20-cc.0"
dependencies:
"@wireapp/api-client": ^24.15.6-draft-20-cc.0
"@wireapp/api-client": ^24.15.7-draft-20-cc.0
"@wireapp/commons": ^5.1.0
"@wireapp/core-crypto": 1.0.0-pre.5
"@wireapp/cryptobox": 12.8.0
Expand All @@ -6227,7 +6227,7 @@ __metadata:
logdown: 3.3.1
long: ^5.2.0
uuidjs: 4.2.13
checksum: ba82cac4f1e3ff54190098dac9067d3f6d49279b0df8e44f0c78bd1551589343657c3ebecf0d9f2400e23102484e5e2fc0c39ca3731c784523f961fe1e45bb16
checksum: a09cb920666baef651b50f93104c8aa68035428bc1b2f3b117eeecededd37c148ed80fbbca4f403d77d4b43fbda70a9e62481478d978b34918ef51d9dc3605ae
languageName: node
linkType: hard

Expand Down Expand Up @@ -19049,7 +19049,7 @@ dexie@latest:
"@typescript-eslint/parser": ^5.59.11
"@wireapp/avs": 9.2.15
"@wireapp/copy-config": 2.1.1
"@wireapp/core": 40.5.3-draft-20-cc.0
"@wireapp/core": 40.5.5-draft-20-cc.0
"@wireapp/eslint-config": 2.2.2
"@wireapp/lru-cache": 3.8.1
"@wireapp/prettier-config": 0.6.0
Expand Down

0 comments on commit af7529c

Please sign in to comment.