From 79a8a347a6c55a3ec6255227930dd9aad4b0b78f Mon Sep 17 00:00:00 2001 From: Krombel Date: Wed, 29 Aug 2018 16:26:21 +0200 Subject: [PATCH 1/2] fix #3445 itervalues(d) calls d.itervalues() [PY2] and d.values() [PY3] but SortedDict only implements d.values() --- changelog.d/3445.bugfix | 1 + synapse/federation/send_queue.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/3445.bugfix diff --git a/changelog.d/3445.bugfix b/changelog.d/3445.bugfix new file mode 100644 index 000000000..f7f1c4778 --- /dev/null +++ b/changelog.d/3445.bugfix @@ -0,0 +1 @@ +do not use six.itervalues() on SortedDict() diff --git a/synapse/federation/send_queue.py b/synapse/federation/send_queue.py index 0bb468385..6f5995735 100644 --- a/synapse/federation/send_queue.py +++ b/synapse/federation/send_queue.py @@ -32,7 +32,7 @@ Events are replicated via a separate events stream. import logging from collections import namedtuple -from six import iteritems, itervalues +from six import iteritems from sortedcontainers import SortedDict @@ -117,7 +117,7 @@ class FederationRemoteSendQueue(object): user_ids = set( user_id - for uids in itervalues(self.presence_changed) + for uids in self.presence_changed.values() for user_id in uids ) From 8c0c51ecb337c4dbbec371375e9c376fb2f666f7 Mon Sep 17 00:00:00 2001 From: Krombel Date: Wed, 29 Aug 2018 16:49:26 +0200 Subject: [PATCH 2/2] changelog --- changelog.d/3445.bugfix | 1 - changelog.d/3768.bugfix | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 changelog.d/3445.bugfix create mode 100644 changelog.d/3768.bugfix diff --git a/changelog.d/3445.bugfix b/changelog.d/3445.bugfix deleted file mode 100644 index f7f1c4778..000000000 --- a/changelog.d/3445.bugfix +++ /dev/null @@ -1 +0,0 @@ -do not use six.itervalues() on SortedDict() diff --git a/changelog.d/3768.bugfix b/changelog.d/3768.bugfix new file mode 100644 index 000000000..a039a7fa6 --- /dev/null +++ b/changelog.d/3768.bugfix @@ -0,0 +1 @@ +Fix bug in sending presence over federation