Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix /federation/v1/state for recent room versions (#6170)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 26, 2020
2 parents f822f3b + b94a401 commit 6b9f0e9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
1 change: 1 addition & 0 deletions changelog.d/6170.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix /federation/v1/state endpoint for recent room versions.
2 changes: 1 addition & 1 deletion changelog.d/6175.misc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Update `user_filters` table to have a unique index, and non-null columns. Thanks to @pik for contributing this
Update `user_filters` table to have a unique index, and non-null columns. Thanks to @pik for contributing this.
13 changes: 0 additions & 13 deletions synapse/federation/federation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
UnsupportedRoomVersionError,
)
from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
from synapse.crypto.event_signing import compute_event_signature
from synapse.events import room_version_to_event_format
from synapse.federation.federation_base import FederationBase, event_from_pdu_json
from synapse.federation.persistence import TransactionActions
Expand Down Expand Up @@ -322,18 +321,6 @@ def _on_context_state_request_compute(self, room_id, event_id):
pdus = yield self.handler.get_state_for_pdu(room_id, event_id)
auth_chain = yield self.store.get_auth_chain([pdu.event_id for pdu in pdus])

for event in auth_chain:
# We sign these again because there was a bug where we
# incorrectly signed things the first time round
if self.hs.is_mine_id(event.event_id):
event.signatures.update(
compute_event_signature(
event.get_pdu_json(),
self.hs.hostname,
self.hs.config.signing_key[0],
)
)

return {
"pdus": [pdu.get_pdu_json() for pdu in pdus],
"auth_chain": [pdu.get_pdu_json() for pdu in auth_chain],
Expand Down

0 comments on commit 6b9f0e9

Please sign in to comment.