-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Announce deleted devices explicitly over federation. #3520
Conversation
Previously we queued up the poke correctly when the device was deleted, but then the actual EDU wouldn't get sent, as the device was no longer known. Instead, we now send EDUs for deleted devices too if there's a poke for them.
and generally make it work.
@matrixbot retest this please |
synapse/storage/devices.py
Outdated
}, | ||
) | ||
|
||
# Do we need this? |
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'd rather not have to go and figure this out myself...
it seems odd that it would be needed here and not in the upsert case.
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 believe it is needed, as that cache is used to track device existence and we're deleting a device here. whereas in the upsert case we're not deleting a device.
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.
ok, the critical piece of information here was that device_id_exists_cache
only caches the presence of devices, not the absence of them, which is why we don't need to update it when we insert a new device.
synapse/storage/end_to_end_keys.py
Outdated
"""Fetch a list of device keys. | ||
Args: | ||
query_list(list): List of pairs of user_ids and device_ids. | ||
include_all_devices (bool): whether to include entries for devices | ||
that don't have device keys | ||
include_deleted_devices (bool): whether to include null entries for | ||
devices which no longer exist (but were in the query_list) |
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.
how does this interact with include_all_devices
? can haz doc pls
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.
done.
(this is also blocked on getting some agreement on exactly what the format of the EDUs on the wire is) |
looks like i completely misread the code of how the EDU payloads were structured; my bad. Thanks for digging in and fixing it. ptal? |
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
synapse/storage/end_to_end_keys.py
Outdated
def get_e2e_device_keys(self, query_list, include_all_devices=False): | ||
def get_e2e_device_keys( | ||
self, query_list, include_all_devices=False, | ||
include_deleted_devices=False |
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.
trailing comma would be nice here
Adds a new
deleted
flag on them.device_list_update
EDU contents to notify when a device has been deleted. This should be nicely backwards compatible with existing servers.Specced at the bottom of https://docs.google.com/document/d/1fNBZUeMlp0fn0en5bCji5fn6mSvj48UylWfGKrk8ZIw/edit#
Fixes element-hq/element-web#4527
Sytest: matrix-org/sytest#463