Stop depending on `room_id` to be returned for children state in the hierarchy response. (#12991)

The `room_id` field was removed from MSC2946 before
it was accepted. It was initially kept for backwards compatibility
and should be removed now that the stable form of the API
is used.

This change only stops Synapse from validating that it is returned,
a future PR will remove returning it as part of the response.
This commit is contained in:
Patrick Cloke 2022-06-10 07:15:51 -04:00 committed by GitHub
parent 3d1d510fa9
commit 81608490e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

2
changelog.d/12991.bugfix Normal file
View File

@ -0,0 +1,2 @@
Fix a bug where non-standard information was required when requesting the `/hierarchy` API over federation. Introduced
in Synapse v1.41.0.

View File

@ -1642,10 +1642,6 @@ def _validate_hierarchy_event(d: JsonDict) -> None:
if not isinstance(event_type, str): if not isinstance(event_type, str):
raise ValueError("Invalid event: 'event_type' must be a str") raise ValueError("Invalid event: 'event_type' must be a str")
room_id = d.get("room_id")
if not isinstance(room_id, str):
raise ValueError("Invalid event: 'room_id' must be a str")
state_key = d.get("state_key") state_key = d.get("state_key")
if not isinstance(state_key, str): if not isinstance(state_key, str):
raise ValueError("Invalid event: 'state_key' must be a str") raise ValueError("Invalid event: 'state_key' must be a str")

View File

@ -178,7 +178,7 @@ class SpaceSummaryTestCase(unittest.HomeserverTestCase):
result_room_ids.append(result_room["room_id"]) result_room_ids.append(result_room["room_id"])
result_children_ids.append( result_children_ids.append(
[ [
(cs["room_id"], cs["state_key"]) (result_room["room_id"], cs["state_key"])
for cs in result_room["children_state"] for cs in result_room["children_state"]
] ]
) )