You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Some users, e.g. appservice users, won't have any devices whatsoever. If we query their homeserver to retrieve that user's devices, it should respond with an empty list of devices. In the processing of that response, by the time we reach this line we have a devices list from a successful response whose size is at most 999.
We transform devices into a dictionary {d["device_id"]: d for d in devices}. Assuming there are no repeated device_ids, this is a reversible transformation.
Suppose we have never cached devices for this user, and that the devices list is empty. Then cached_devices will be an empty dictionary and so too will the transformed version of devices. Thus we'll set ignore_devices = True and not cache the fact that this user has no devices.
Then, whenever someone wants this user's device again, we'll repeat the federation request again.
The text was updated successfully, but these errors were encountered:
We suspect this contributed to performance problems on the master today, after a room on t2bot.io containing bridged (deviceless!) users had encryption enabled.
Spotted by @squahtx.
Some users, e.g. appservice users, won't have any devices whatsoever. If we query their homeserver to retrieve that user's devices, it should respond with an empty list of
devices
. In the processing of that response, by the time we reach this line we have adevices
list from a successful response whose size is at most 999.We transform
devices
into a dictionary{d["device_id"]: d for d in devices}
. Assuming there are no repeated device_ids, this is a reversible transformation.synapse/synapse/handlers/device.py
Lines 951 to 958 in e5cdb9e
Here,
cached_devices
is:synapse/synapse/storage/databases/main/devices.py
Lines 555 to 565 in 5305a5e
Suppose we have never cached devices for this user, and that the
devices
list is empty. Thencached_devices
will be an empty dictionary and so too will the transformed version of devices. Thus we'll setignore_devices = True
and not cache the fact that this user has no devices.Then, whenever someone wants this user's device again, we'll repeat the federation request again.
The text was updated successfully, but these errors were encountered: