diff --git a/synapse/storage/databases/main/devices.py b/synapse/storage/databases/main/devices.py index edbd1f9f2292..1e2425e6ed19 100644 --- a/synapse/storage/databases/main/devices.py +++ b/synapse/storage/databases/main/devices.py @@ -1564,6 +1564,7 @@ async def check_too_many_devices_for_user(self, user_id: str) -> Collection[str] # that ensures we keep at most 50 devices. sql = """ SELECT last_seen FROM devices + LEFT JOIN e2e_device_keys_json USING (user_id, device_id) WHERE user_id = ? AND NOT hidden