Merge remote-tracking branch 'origin/erikj/fix_device_comparison' into matrix-org-hotfixes

This commit is contained in:
Richard van der Hoff 2018-11-08 12:48:19 +00:00
commit c08c649fa1
2 changed files with 5 additions and 1 deletions

1
changelog.d/4164.bugfix Normal file
View file

@ -0,0 +1 @@
Fix noop checks when updating device keys, reducing spurious device list update notifications.

View file

@ -40,7 +40,10 @@ class EndToEndKeyStore(SQLBaseStore):
allow_none=True,
)
new_key_json = encode_canonical_json(device_keys)
# In py3 we need old_key_json to match new_key_json type. The DB
# returns unicode while encode_canonical_json returns bytes.
new_key_json = encode_canonical_json(device_keys).decode("utf-8")
if old_key_json == new_key_json:
return False