Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Ignore device list updates for users with large numbers of devices
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Nov 22, 2022
1 parent c333651 commit 5436c3e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synapse/storage/databases/main/deviceinbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,10 @@ def _add_messages_to_local_device_inbox_txn(
retcol="device_id",
)

if len(devices) > 1000:
logger.warn("ignoring wildcard to-device messages to %i devices", len(devices))
continue

message_json = json_encoder.encode(messages_by_device["*"])
for device_id in devices:
# Add the message for all devices for this user on this
Expand Down

0 comments on commit 5436c3e

Please sign in to comment.