-
Notifications
You must be signed in to change notification settings - Fork 216
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
Simplify user verification state #1740
Conversation
aed6ee7
to
1635415
Compare
1635415
to
3fef185
Compare
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.
LGTM
b29001d
to
1dafa92
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #1740 +/- ##
===========================================
+ Coverage 37.75% 37.78% +0.02%
===========================================
Files 615 616 +1
Lines 96889 96899 +10
Branches 41856 41867 +11
===========================================
+ Hits 36580 36610 +30
+ Misses 59261 59242 -19
+ Partials 1048 1047 -1
... and 5 files with indirect coverage changes 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 in Codecov by Sentry. |
Resolves https://github.com/matrix-org/internal-config/issues/1325
The SDK has previously relied on
MXUserTrustLevel
to determine whether any particular user is verified or not. It did so by distinguishing between "local" and "cross-signed" trust, where a user is considered verified if either one of those fields is true. This is however unnecessarily complex model, not used upcoming rust-crypto, and does not really make sense, given that "user verification" should only be possible via cross-signing, not by setting manual values.To improve this, remove
MXUserTrustLevel
entirely and replace it with a simpleisVerified
boolean. This makes the API everywhere much simpler to use. As a downside, we have to deal with some amount of migration from the previous model (we use NSCoding to persist these values). To ensure correct migration, we will now store "version" property in MXCrossSigningInfo, which is used to decode the values correctlyAdditionally replace
NSProgress
withMXTrustSummary
when computingtrustSummary
for more than one user or device. UsingNSProgress
has worked okay, but it makes for some strange and clunky API (e.g..fractionCompleted >= 0
instead ofallAreTrusted
).