-
Notifications
You must be signed in to change notification settings - Fork 290
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: MLSStateHandler updates clientEntities directly #16008
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #16008 +/- ##
==========================================
+ Coverage 44.73% 44.76% +0.03%
==========================================
Files 701 701
Lines 23288 23308 +20
Branches 5285 5289 +4
==========================================
+ Hits 10417 10433 +16
- Misses 11514 11517 +3
- Partials 1357 1358 +1 |
@@ -26,32 +26,32 @@ __metadata: | |||
linkType: hard | |||
|
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.
I needed to fix yarn.lock issues.
Did that by clearing the locks and rebuilding them freshly. Thats why some packages got updates
|
||
// If the number of userDevicePairs is not equal to the number of identities, our Conversation is not secure | ||
if (!isResultComplete) { | ||
return this.degradeConversation(conversationEntity, qualifiedIds); | ||
} | ||
|
||
// We need to check if identities are valid and not expired |
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.
This check is being done in updateUserDevices now
deviceUserPairs, | ||
); | ||
identities.forEach(async identity => { | ||
const verified = await this.isCertificateActiveAndValid(identity.certificate); |
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.
Verify the certificate, add it to allIdentities only when being valid
return {...acc, ...current}; | ||
}, {}); | ||
const identities = await this.core.service!.e2eIdentity!.getUserDeviceEntities( | ||
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.
I think there is a isMLSConversation
that will also make sure that this groupId
is present ;)
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.
have a look at the ConversationSelector.ts
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 point. Changed the types and added the guard
/** | ||
* ToDo: Change the current implementation of isMLSVerified to be stored in Zustand instead of ko.observable | ||
*/ | ||
device?.meta.isMLSVerified?.(true); |
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.
This meta is saved to the DB, right?
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.
Yes, it should. I added all the entries for that.
The DB entries get initialized with it, and it is also added in the devices toJSON method.
Change the implementation to utilise the new observable isMLSVerified on the clientEntity level.