From 47b88714eb6177367320843bf56d5ad8ec45f303 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 9 May 2019 07:59:22 +0200 Subject: [PATCH] Add an assert to check that limit has been enforced after calling get_devices_by_remote Signed-off-by: Quentin Dufour --- synapse/federation/sender/per_destination_queue.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/synapse/federation/sender/per_destination_queue.py b/synapse/federation/sender/per_destination_queue.py index a9e77793d031..4d96f026c664 100644 --- a/synapse/federation/sender/per_destination_queue.py +++ b/synapse/federation/sender/per_destination_queue.py @@ -362,6 +362,8 @@ def _get_new_device_messages(self, limit): for content in results ] + assert len(edus) <= limit, "get_devices_by_remote returned too many EDUs" + last_device_stream_id = self._last_device_stream_id to_device_stream_id = self._store.get_to_device_stream_token() contents, stream_id = yield self._store.get_new_device_msgs_for_remote(