From 73451b12cf748b0b0716a87a2a709bb73614dbdc Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Sat, 7 Aug 2021 01:35:57 -0500 Subject: [PATCH 1/3] Only return state events that the AS passed in via state_events_at_start As discovered by @Half-Shot in https://github.com/matrix-org/matrix-doc/pull/2716#discussion_r684158448 Part of MSC2716 --- synapse/rest/client/v1/room.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py index 502a91758813..86d143ae0d1c 100644 --- a/synapse/rest/client/v1/room.py +++ b/synapse/rest/client/v1/room.py @@ -438,6 +438,7 @@ async def on_POST(self, request, room_id): prev_state_ids = list(prev_state_map.values()) auth_event_ids = prev_state_ids + state_events_at_start = [] for state_event in body["state_events_at_start"]: assert_params_in_dict( state_event, ["type", "origin_server_ts", "content", "sender"] @@ -500,6 +501,7 @@ async def on_POST(self, request, room_id): ) event_id = event.event_id + state_events_at_start.append(event_id) auth_event_ids.append(event_id) events_to_create = body["events"] @@ -647,7 +649,7 @@ async def on_POST(self, request, room_id): event_ids.append(base_insertion_event.event_id) return 200, { - "state_events": auth_event_ids, + "state_events": state_events_at_start, "events": event_ids, "next_chunk_id": insertion_event["content"][ EventContentFields.MSC2716_NEXT_CHUNK_ID From 7aa2e848affe93c089fd610ec8127f9b76c834e9 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Sat, 7 Aug 2021 01:46:10 -0500 Subject: [PATCH 2/3] Add changelog --- changelog.d/10552.msc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/10552.msc diff --git a/changelog.d/10552.msc b/changelog.d/10552.msc new file mode 100644 index 000000000000..fc5f6aea5ffb --- /dev/null +++ b/changelog.d/10552.msc @@ -0,0 +1 @@ +Update `/batch_send` endpoint to only return `state_events` created by the `state_events_from_before` passed in. From 7554c0e78df4a28f52304f8d92607b20a5927c8b Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Sat, 7 Aug 2021 19:23:12 -0500 Subject: [PATCH 3/3] Fix changelog extension --- changelog.d/{10552.msc => 10552.misc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog.d/{10552.msc => 10552.misc} (100%) diff --git a/changelog.d/10552.msc b/changelog.d/10552.misc similarity index 100% rename from changelog.d/10552.msc rename to changelog.d/10552.misc