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

Curate MXCrypto protocol methods #1618

Merged
merged 1 commit into from
Oct 26, 2022
Merged

Curate MXCrypto protocol methods #1618

merged 1 commit into from
Oct 26, 2022

Conversation

Anderas
Copy link
Contributor

@Anderas Anderas commented Oct 25, 2022

A number of related changes to the MXCrypto protocol:

  • cleanup MXCrypto protocol by moving a number of methods and properties into MXLegacyCrypto, because they are used only with the legacy implementation of the crypto module, and thus do not need to be implemented by MXCryptoV2
  • consolidate similar methods trustLevelSummary into one
  • deprecate legacy synchronous decryptEvent method
  • track duration of encrypting an event with Crypto V2

Note that in the future PR the remaining unimplemented methods in CryptoV2 will be dealt with

@Anderas Anderas changed the title Curate MXCrypto methods Curate MXCrypto protocol methods Oct 25, 2022
@Anderas Anderas requested review from a team and gileluard and removed request for a team October 25, 2022 17:04
@@ -314,6 +314,11 @@ - (void)signUserWithUserId:(NSString*)userId
});
}

- (MXCrossSigningInfo *)crossSigningKeysForUser:(NSString *)userId
{
return [self.crypto.store crossSigningKeysForUser:userId];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implementation merely moved here from MXCrypto

/**
The secret storage on homeserver manager.
*/
@property (nonatomic, readonly) MXSecretStorage *secretStorage;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of these (apart from deprecated decryptEvent and duplciate trustLevelSummary) are just moved to MXLegacyCrypto without change

@@ -48,6 +48,7 @@ public actor MXTaskQueue {
assertionFailure("Failing to get value of the correct type should not be possible")
throw Error.valueUnavailable
}
previousTask = nil
Copy link
Contributor Author

@Anderas Anderas Oct 25, 2022

Choose a reason for hiding this comment

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

Unrelated and untestable change that clears a Task after it has been completed. Without this change everything works as normal, but we keep a supended Task in memory unnecessarily

@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Base: 25.71% // Head: 36.37% // Increases project coverage by +10.65% 🎉

Coverage data is based on head (afa3d61) compared to base (2aa4808).
Patch coverage: 25.77% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #1618       +/-   ##
============================================
+ Coverage    25.71%   36.37%   +10.65%     
============================================
  Files          577      577               
  Lines        90963    90876       -87     
  Branches     39486    39539       +53     
============================================
+ Hits         23391    33056     +9665     
+ Misses       66807    56838     -9969     
- Partials       765      982      +217     
Impacted Files Coverage Δ
...Crypto/CrossSigning/MXCrossSigningInfoSource.swift 100.00% <ø> (+100.00%) ⬆️
...trixSDK/Crypto/CrossSigning/MXCrossSigningV2.swift 22.36% <0.00%> (+22.36%) ⬆️
MatrixSDK/Crypto/MXCryptoV2.swift 0.89% <0.00%> (+0.06%) ⬆️
...SDK/Crypto/Verification/MXKeyVerificationManager.m 53.46% <0.00%> (ø)
...ossSigning/MXCrossSigningInfoSourceUnitTests.swift 100.00% <ø> (+100.00%) ⬆️
MatrixSDKTests/MXCryptoRecoveryServiceTests.m 0.00% <0.00%> (ø)
MatrixSDKTests/MXCryptoSecretShareTests.m 0.00% <0.00%> (ø)
MatrixSDKTests/MXCryptoShareTests.m 39.90% <0.00%> (ø)
MatrixSDK/Crypto/MXCrypto.m 64.30% <50.00%> (-0.36%) ⬇️
MatrixSDK/Data/MXRoom.m 38.12% <50.00%> (+0.15%) ⬆️
... and 208 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@gileluard gileluard left a comment

Choose a reason for hiding this comment

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

lgtm

@Anderas Anderas merged commit d74b476 into develop Oct 26, 2022
@Anderas Anderas deleted the andy/crypto_methods branch October 26, 2022 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants