diff options
author | Erik Johnston <erik@matrix.org> | 2018-08-23 16:20:51 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-08-23 16:21:20 +0100 |
commit | 7e6e588e60708be3e58f026bd65bd4680f9cd969 (patch) | |
tree | a4fb959c192c94f77b92e88d0b3ee8c98db135cb /synapse | |
parent | Merge pull request #3734 from matrix-org/travis/worker-docs (diff) | |
download | synapse-7e6e588e60708be3e58f026bd65bd4680f9cd969.tar.xz |
Fix bug where we resent "limit exceeded" server notices
This was due to a bug where we mutated a cached event's contents
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/server_notices/resource_limits_server_notices.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/server_notices/resource_limits_server_notices.py b/synapse/server_notices/resource_limits_server_notices.py index 575697e54b..96eb97771f 100644 --- a/synapse/server_notices/resource_limits_server_notices.py +++ b/synapse/server_notices/resource_limits_server_notices.py @@ -76,6 +76,10 @@ class ResourceLimitsServerNotices(object): room_id = yield self._server_notices_manager.get_notice_room_for_user(user_id) + if not room_id: + logger.warn("Failed to get server notices room") + return + yield self._check_and_set_tags(user_id, room_id) currently_blocked, ref_events = yield self._is_room_currently_blocked(room_id) @@ -176,7 +180,7 @@ class ResourceLimitsServerNotices(object): referenced_events = [] if pinned_state_event is not None: - referenced_events = pinned_state_event.content.get('pinned') + referenced_events = list(pinned_state_event.content.get('pinned', [])) events = yield self._store.get_events(referenced_events) for event_id, event in iteritems(events): |