Cast a coroutine into a Deferred in the federation base (#6996)

Properly convert a coroutine into a Deferred in federation_base to fix an error when joining a room.
This commit is contained in:
Patrick Cloke 2020-02-26 11:32:13 -05:00 committed by GitHub
parent 9c1b83b007
commit 380122866f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

1
changelog.d/6996.bugfix Normal file
View File

@ -0,0 +1 @@
Fix bug which caused an error when joining a room, with `'coroutine' object has no attribute 'event_id'`.

View File

@ -96,12 +96,14 @@ class FederationBase(object):
if not res and pdu.origin != origin: if not res and pdu.origin != origin:
try: try:
res = yield self.get_pdu( res = yield defer.ensureDeferred(
destinations=[pdu.origin], self.get_pdu(
event_id=pdu.event_id, destinations=[pdu.origin],
room_version=room_version, event_id=pdu.event_id,
outlier=outlier, room_version=room_version,
timeout=10000, outlier=outlier,
timeout=10000,
)
) )
except SynapseError: except SynapseError:
pass pass