From e899e0ba2ce639cfd6c889ead812c27cb30de3b0 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 5 Oct 2022 15:49:13 +0100 Subject: [PATCH 1/3] Stop returning unsigned.invite_room_state in v2 invite fed responses We were accidentally returning an 'invite_room_state' field in the 'unsigned' dict of invite events in response to a PUT /_matrix/federation/v2/invite/{roomId}/{eventId} request. --- synapse/federation/transport/server/federation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/synapse/federation/transport/server/federation.py b/synapse/federation/transport/server/federation.py index 6bb4659c4c9e..9dedb71ec2dc 100644 --- a/synapse/federation/transport/server/federation.py +++ b/synapse/federation/transport/server/federation.py @@ -499,6 +499,11 @@ async def on_PUT( result = await self.handler.on_invite_request( origin, event, room_version_id=room_version ) + + # We only store invite_room_state for internal use, so remove it before + # returning the event to the remote homeserver. + result["event"].get("unsigned", {}).pop("invite_room_state", None) + return 200, result From ceef1fc68cb9ddf35a8c38228890b74131d0d002 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 5 Oct 2022 16:29:45 +0100 Subject: [PATCH 2/3] changelog --- changelog.d/14064.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/14064.bugfix diff --git a/changelog.d/14064.bugfix b/changelog.d/14064.bugfix new file mode 100644 index 000000000000..4a209d4c04f3 --- /dev/null +++ b/changelog.d/14064.bugfix @@ -0,0 +1 @@ +Fix a long-standing bug where Synapse would accidentally include extra information in the response to [`PUT /_matrix/federation/v2/invite/{roomId}/{eventId}`](https://spec.matrix.org/v1.4/server-server-api/#put_matrixfederationv2inviteroomideventid). \ No newline at end of file From 72fe1f7002a1abac43b374b0329991b182ac4cd0 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 6 Oct 2022 15:38:54 +0100 Subject: [PATCH 3/3] kick CI --- changelog.d/14064.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/14064.bugfix b/changelog.d/14064.bugfix index 4a209d4c04f3..cce6ef3b710c 100644 --- a/changelog.d/14064.bugfix +++ b/changelog.d/14064.bugfix @@ -1 +1 @@ -Fix a long-standing bug where Synapse would accidentally include extra information in the response to [`PUT /_matrix/federation/v2/invite/{roomId}/{eventId}`](https://spec.matrix.org/v1.4/server-server-api/#put_matrixfederationv2inviteroomideventid). \ No newline at end of file + Fix a long-standing bug where Synapse would accidentally include extra information in the response to [`PUT /_matrix/federation/v2/invite/{roomId}/{eventId}`](https://spec.matrix.org/v1.4/server-server-api/#put_matrixfederationv2inviteroomideventid). \ No newline at end of file