diff --git a/synapse/rest/client/room.py b/synapse/rest/client/room.py index 4fd754a06c..ab92cd3df8 100644 --- a/synapse/rest/client/room.py +++ b/synapse/rest/client/room.py @@ -861,7 +861,7 @@ async def encode_messages_response( bundle_aggregations=get_messages_result.bundled_aggregations, ) ), - "gaps": [ + "org.matrix.msc3871.gaps": [ { "prev_pagination_token": await get_messages_result.start_token.copy_and_replace( StreamKeyType.ROOM, gap.prev_token diff --git a/tests/rest/client/test_rooms.py b/tests/rest/client/test_rooms.py index 3083dd2744..1a367a47c4 100644 --- a/tests/rest/client/test_rooms.py +++ b/tests/rest/client/test_rooms.py @@ -2530,7 +2530,7 @@ class RoomMessageListTestCase(RoomBase): # Make sure the gaps are correct actual_gaps = [ event_id_to_message_map.get(gap["event_id"], gap["event_id"]) - for gap in channel.json_body["gaps"] + for gap in channel.json_body["org.matrix.msc3871.gaps"] ] expected_gaps = expected_messages # We only need to assert that gaps are in the list (the order doesn't matter) @@ -2540,7 +2540,7 @@ class RoomMessageListTestCase(RoomBase): exact=True, ) # Ensure that the tokens point to the correct positions - for gap in channel.json_body["gaps"]: + for gap in channel.json_body["org.matrix.msc3871.gaps"]: event_room_stream_token = self.get_success( self.store.get_topological_token_for_event(gap["event_id"]) )