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

feat: MLSStateHandler updates clientEntities directly #16008

Merged
merged 6 commits into from
Oct 16, 2023

Conversation

aweiss-dev
Copy link
Member

Change the implementation to utilise the new observable isMLSVerified on the clientEntity level.

package.json Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #16008 (9ca69fa) into dev (5738385) will increase coverage by 0.03%.
Report is 1 commits behind head on dev.
The diff coverage is 94.11%.

❗ Current head 9ca69fa differs from pull request most recent head 4345b18. Consider uploading reports for the commit 4345b18 to get more accurate results

@@            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

Copy link
Member Author

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
Copy link
Member Author

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);
Copy link
Member Author

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!,
Copy link
Contributor

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 ;)

Copy link
Contributor

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

Copy link
Member Author

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);
Copy link
Contributor

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?

Copy link
Member Author

@aweiss-dev aweiss-dev Oct 16, 2023

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.

@aweiss-dev aweiss-dev merged commit 2a6b70d into dev Oct 16, 2023
12 checks passed
@aweiss-dev aweiss-dev deleted the feat/update_devices branch October 16, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants