From 946ec98b6bd74175f62dbb257f1b8301ad722727 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 26 Feb 2020 10:30:04 -0500 Subject: [PATCH 1/4] Properly convert a coroutine into a Deferred for federation_base. --- synapse/federation/federation_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/federation/federation_base.py b/synapse/federation/federation_base.py index eea64c1c9f84..da4fe03b5e9e 100644 --- a/synapse/federation/federation_base.py +++ b/synapse/federation/federation_base.py @@ -96,13 +96,13 @@ def handle_check_result(pdu, deferred): if not res and pdu.origin != origin: try: - res = yield self.get_pdu( + res = yield defer.ensureDeferred(self.get_pdu( destinations=[pdu.origin], event_id=pdu.event_id, room_version=room_version, outlier=outlier, timeout=10000, - ) + )) except SynapseError: pass From d64095b1d6f40c2a162e0e527d184dd1321f030b Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 26 Feb 2020 10:35:47 -0500 Subject: [PATCH 2/4] Add changelog file. --- changelog.d/6996.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6996.bugfix diff --git a/changelog.d/6996.bugfix b/changelog.d/6996.bugfix new file mode 100644 index 000000000000..c97d96168c41 --- /dev/null +++ b/changelog.d/6996.bugfix @@ -0,0 +1 @@ +Properly handle the result of FederationClient.get_pdu as a coroutine. From 126f3bd2595a697aa3e42239bb4c9691fbb7647a Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 26 Feb 2020 10:36:40 -0500 Subject: [PATCH 3/4] Run black. --- synapse/federation/federation_base.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/synapse/federation/federation_base.py b/synapse/federation/federation_base.py index da4fe03b5e9e..9fff65716ae2 100644 --- a/synapse/federation/federation_base.py +++ b/synapse/federation/federation_base.py @@ -96,13 +96,15 @@ def handle_check_result(pdu, deferred): if not res and pdu.origin != origin: try: - res = yield defer.ensureDeferred(self.get_pdu( - destinations=[pdu.origin], - event_id=pdu.event_id, - room_version=room_version, - outlier=outlier, - timeout=10000, - )) + res = yield defer.ensureDeferred( + self.get_pdu( + destinations=[pdu.origin], + event_id=pdu.event_id, + room_version=room_version, + outlier=outlier, + timeout=10000, + ) + ) except SynapseError: pass From a0e61479f8c1cfb31f6adf58c5ab28d15c0b0be2 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 26 Feb 2020 11:07:28 -0500 Subject: [PATCH 4/4] Update the changelog entry. --- changelog.d/6996.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/6996.bugfix b/changelog.d/6996.bugfix index c97d96168c41..765d376c7c7c 100644 --- a/changelog.d/6996.bugfix +++ b/changelog.d/6996.bugfix @@ -1 +1 @@ -Properly handle the result of FederationClient.get_pdu as a coroutine. +Fix bug which caused an error when joining a room, with `'coroutine' object has no attribute 'event_id'`.