-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Invalidate device lists when encryption is enabled in a room #359
Conversation
we only really hit this in the tests, but it's a bit silly to download the complete device list on every message.
89ced19 added some code which flagged our own device list as in need of an update. However, 8d50274 then added code such that we invalidate *all* members of e2e rooms on the first initialsync - which should include ourselves. We can therefore remove the redundant special-case, which mostly serves to simplify the tests.
@@ -64,7 +64,7 @@ OlmEncryption.prototype._ensureSession = function(roomMembers) { | |||
} | |||
|
|||
const self = this; | |||
this._prepPromise = self._crypto.downloadKeys(roomMembers, true).then(function(res) { | |||
this._prepPromise = self._crypto.downloadKeys(roomMembers).then(function(res) { |
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.
is this for the old m.room.encrypted m.olm.v1.curve25519-aes-sha2
messages?
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.
yup. that's why it hasn't been a problem in practice.
@@ -351,7 +351,6 @@ describe("MatrixClient", function() { | |||
|
|||
httpBackend.when("POST", "/keys/query").check(function(req) { | |||
expect(req.data).toEqual({device_keys: { | |||
'@alice:localhost': {}, |
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'm a little surprised that we no longer see our own key here...
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.
or rather, our own userId.
so... the reason for this is, as per the comment on bd07310, we no longer automatically queue up our own userId as needing a refresh - instead it happens once the initialsync happens. In this test, there is no initialsync, so our own userid isn't invalidated.
type: 'm.room.encryption', | ||
skey: '', | ||
content: { | ||
algorithm: 'm.olm.v1.curve25519-aes-sha2', |
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.
should I be surprised that the alg here is olm and not megolm, given it's for a room?
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.
Per
* Note that megolm (group) conversation is not tested here. |
sounds plausible to me, modulo a few questions of confusion |
lgtm |
... and other stories.
Most of this was cleanup work to get to a state where this change didn't break all the tests inexplicably. The commits might make some sense on their own - or I can pull it into separate PRs if you like.