Patch to temporarily drop cross-user m.key_share_requests (#8675)
Cross-user `m.key_share_requests` are a relatively new `to_device` message that allows user to re-request session keys for a message from another user if they were otherwise unable to retrieve them. Unfortunately, these have had performance concerns on matrix.org. This is a temporary patch to disable them while we investigate a better solution.michaelkaye/remove_warning
parent
bcb6b243e9
commit
d60af9305a
|
@ -0,0 +1 @@
|
||||||
|
Temporarily drop cross-user m.room_key_request to_device messages over performance concerns.
|
|
@ -915,6 +915,10 @@ class FederationHandlerRegistry:
|
||||||
if not self.config.use_presence and edu_type == "m.presence":
|
if not self.config.use_presence and edu_type == "m.presence":
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Temporary patch to drop cross-user key share requests
|
||||||
|
if edu_type == "m.room_key_request":
|
||||||
|
return
|
||||||
|
|
||||||
# Check if we have a handler on this instance
|
# Check if we have a handler on this instance
|
||||||
handler = self.edu_handlers.get(edu_type)
|
handler = self.edu_handlers.get(edu_type)
|
||||||
if handler:
|
if handler:
|
||||||
|
|
|
@ -153,6 +153,10 @@ class DeviceMessageHandler:
|
||||||
local_messages = {}
|
local_messages = {}
|
||||||
remote_messages = {} # type: Dict[str, Dict[str, Dict[str, JsonDict]]]
|
remote_messages = {} # type: Dict[str, Dict[str, Dict[str, JsonDict]]]
|
||||||
for user_id, by_device in messages.items():
|
for user_id, by_device in messages.items():
|
||||||
|
# Temporary patch to disable sending local cross-user key requests.
|
||||||
|
if message_type == "m.room_key_request" and user_id != sender_user_id:
|
||||||
|
continue
|
||||||
|
|
||||||
# we use UserID.from_string to catch invalid user ids
|
# we use UserID.from_string to catch invalid user ids
|
||||||
if self.is_mine(UserID.from_string(user_id)):
|
if self.is_mine(UserID.from_string(user_id)):
|
||||||
messages_by_device = {
|
messages_by_device = {
|
||||||
|
|
Loading…
Reference in New Issue