batching of m.room_key
to-device messages is suboptimal
#24680
Labels
A-E2EE
O-Occasional
Affects or can be seen by some users regularly or most users rarely
S-Minor
Impairs non-critical functionality or suitable workarounds exist
T-Defect
Team: Crypto
Z-Legacy-Crypto
Issues affecting the legacy crypto stack
When we send out
m.room_key
messages to share a new encryption session, we attempt to batch those messages into groups of 20 per call to/sendToDevice
. However the batching logic is distinctly suboptimal and we often end up creating much smaller batches.I'm also not really sure why 20 was chosen as the target.
This leads to lots of requests to the
/sendToDevice
endpoint and general slowness in sending out room keys, potentially causing unable-to-decrypt errors (element-hq/element-meta#245) and causing the recipient to start sending outm.room_key_request
messages, exacerbating the problem.The text was updated successfully, but these errors were encountered: