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 committed Jun 28, 2023
1 parent fe25f99 commit 3337bfe
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
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
26 changes: 26 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6102,9 +6102,15 @@ __metadata:
languageName: node
linkType: hard

<<<<<<< HEAD
"@wireapp/api-client@npm:^24.16.0":
version: 24.16.0
resolution: "@wireapp/api-client@npm:24.16.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"
>>>>>>> af7529c65 (feat: parse supported protocols (#15379))
dependencies:
"@wireapp/commons": ^5.1.0
"@wireapp/priority-queue": ^2.1.1
Expand All @@ -6117,7 +6123,11 @@ __metadata:
spark-md5: 3.0.2
tough-cookie: 4.1.3
ws: 8.11.0
<<<<<<< HEAD
checksum: 92af35a97144148d460a68c163f9b159fd9b4796376301e1434bf84698fad46980da0bd1409cada959ab82b0de282907e57a2a720955210077f1b96267c22c40
=======
checksum: 45972dcdcfe8775eb0f52420767083be9e0f72d3838565a7567f824282da9ec6c3be8954564d52fa1cba582023ed0cb48255e8750e9b8918e27f06d571ccf526
>>>>>>> af7529c65 (feat: parse supported protocols (#15379))
languageName: node
linkType: hard

Expand Down Expand Up @@ -6170,11 +6180,19 @@ __metadata:
languageName: node
linkType: hard

<<<<<<< HEAD
"@wireapp/core@npm:40.6.0":
version: 40.6.0
resolution: "@wireapp/core@npm:40.6.0"
dependencies:
"@wireapp/api-client": ^24.16.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.7-draft-20-cc.0
>>>>>>> af7529c65 (feat: parse supported protocols (#15379))
"@wireapp/commons": ^5.1.0
"@wireapp/core-crypto": 1.0.0-pre.5
"@wireapp/cryptobox": 12.8.0
Expand All @@ -6191,7 +6209,11 @@ __metadata:
logdown: 3.3.1
long: ^5.2.0
uuidjs: 4.2.13
<<<<<<< HEAD
checksum: e27e71409de6224847a283d30a3c98ed748da40d4a881c940eb372964f3586263fc7691782eaa2ad2239cabaa6b27fa9dd3066c98ca8fc7e5a6511f63788ba99
=======
checksum: a09cb920666baef651b50f93104c8aa68035428bc1b2f3b117eeecededd37c148ed80fbbca4f403d77d4b43fbda70a9e62481478d978b34918ef51d9dc3605ae
>>>>>>> af7529c65 (feat: parse supported protocols (#15379))
languageName: node
linkType: hard

Expand Down Expand Up @@ -19060,7 +19082,11 @@ dexie@latest:
"@typescript-eslint/parser": ^5.60.0
"@wireapp/avs": 9.2.15
"@wireapp/copy-config": 2.1.1
<<<<<<< HEAD
"@wireapp/core": 40.6.0
=======
"@wireapp/core": 40.5.5-draft-20-cc.0
>>>>>>> af7529c65 (feat: parse supported protocols (#15379))
"@wireapp/eslint-config": 2.2.2
"@wireapp/lru-cache": 3.8.1
"@wireapp/prettier-config": 0.6.0
Expand Down

0 comments on commit 3337bfe

Please sign in to comment.