diff options
-rw-r--r-- | changelog.d/5851.bugfix | 2 | ||||
-rw-r--r-- | synapse/federation/transport/server.py | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/changelog.d/5851.bugfix b/changelog.d/5851.bugfix new file mode 100644 index 0000000000..58f7c0c1b8 --- /dev/null +++ b/changelog.d/5851.bugfix @@ -0,0 +1,2 @@ +Fix 500 Internal Server Error on `publicRooms` when the public room list was +cached. diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py index ea4e1b6d0f..9a86bd0263 100644 --- a/synapse/federation/transport/server.py +++ b/synapse/federation/transport/server.py @@ -19,6 +19,8 @@ import functools import logging import re +from twisted.internet.defer import maybeDeferred + import synapse import synapse.logging.opentracing as opentracing from synapse.api.errors import Codes, FederationDeniedError, SynapseError @@ -745,8 +747,12 @@ class PublicRoomList(BaseFederationServlet): else: network_tuple = ThirdPartyInstanceID(None, None) - data = await self.handler.get_local_public_room_list( - limit, since_token, network_tuple=network_tuple, from_federation=True + data = await maybeDeferred( + self.handler.get_local_public_room_list, + limit, + since_token, + network_tuple=network_tuple, + from_federation=True, ) return 200, data |