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: dont run the MLSStateHandler without MLS enabled #15994

Merged
merged 4 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 9 additions & 6 deletions src/script/conversation/ConversationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,15 @@ export class ConversationRepository {
this.userState,
this.conversationState,
);
// we register a handler that will handle MLS conversations on its own
registerMLSConversationVerificationStateHandler(
this.onConversationVerificationStateChange,
this.conversationState,
this.core,
);

if (Config.getConfig().FEATURE.ENABLE_MLS === true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a supportsMLS function in util.ts file we can use instead.

// we register a handler that will handle MLS conversations on its own
registerMLSConversationVerificationStateHandler(
this.onConversationVerificationStateChange,
this.conversationState,
this.core,
);
}

this.isBlockingNotificationHandling = true;
this.conversationsWithNewEvents = new Map();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
this.logger = getLogger('MLSConversationVerificationStateHandler');
// We need to check if the core service is available
if (!this.core.service?.mls) {
this.logger.error('MLS service not available');
this.logger.info('MLS service is not available');

Check failure on line 48 in src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts

View workflow job for this annotation

GitHub Actions / test_build_deploy

MLSConversationVerificationStateHandler › should log an error if MLS service is not available

TypeError: this.logger.info is not a function at new info (src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts:48:19) at Object.<anonymous> (src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.test.ts:76:5)
return;
}
// We need to check if the e2eIdentity service is available
if (!this.core.service?.e2eIdentity) {
this.logger.error('E2E identity service not available');
this.logger.info('E2EIdentity service is not available');

Check failure on line 53 in src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts

View workflow job for this annotation

GitHub Actions / test_build_deploy

MLSConversationVerificationStateHandler › should log an error if e2eIdentity service is not available

TypeError: this.logger.info is not a function at new info (src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.ts:53:19) at Object.<anonymous> (src/script/conversation/ConversationVerificationStateHandler/MLS/MLSStateHandler.test.ts:89:5)
return;
}
// We hook into the newEpoch event of the MLS service to check if the conversation needs to be verified or degraded
Expand Down
Loading