From 04ce82b4b5a564d3c69e3bec04ed202bab221bf9 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 3 Nov 2021 18:53:50 -0500 Subject: [PATCH 1/3] Rename to more clear get_insertion_event_id_by_batch_id `get_insertion_event_by_batch_id` -> `get_insertion_event_id_by_batch_id` Split out from https://github.com/matrix-org/synapse/pull/11114 --- synapse/handlers/message.py | 2 +- synapse/rest/client/room_batch.py | 2 +- synapse/storage/databases/main/room_batch.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index b7bc187169dc..d4c2a6ab7a7d 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -1507,7 +1507,7 @@ async def persist_and_notify_client_event( conflicting_insertion_event_id = None if next_batch_id: conflicting_insertion_event_id = ( - await self.store.get_insertion_event_by_batch_id( + await self.store.get_insertion_event_id_by_batch_id( event.room_id, next_batch_id ) ) diff --git a/synapse/rest/client/room_batch.py b/synapse/rest/client/room_batch.py index ab9a743bba54..6f29c56d6440 100644 --- a/synapse/rest/client/room_batch.py +++ b/synapse/rest/client/room_batch.py @@ -112,7 +112,7 @@ async def on_POST( # and have the batch connected. if batch_id_from_query: corresponding_insertion_event_id = ( - await self.store.get_insertion_event_by_batch_id( + await self.store.get_insertion_event_id_by_batch_id( room_id, batch_id_from_query ) ) diff --git a/synapse/storage/databases/main/room_batch.py b/synapse/storage/databases/main/room_batch.py index dcbce8fdcf03..97b261843782 100644 --- a/synapse/storage/databases/main/room_batch.py +++ b/synapse/storage/databases/main/room_batch.py @@ -18,7 +18,7 @@ class RoomBatchStore(SQLBaseStore): - async def get_insertion_event_by_batch_id( + async def get_insertion_event_id_by_batch_id( self, room_id: str, batch_id: str ) -> Optional[str]: """Retrieve a insertion event ID. From 5789de122555290a8d1dd99492c4c7f9e9e22d7f Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 3 Nov 2021 18:56:28 -0500 Subject: [PATCH 2/3] Add changelog --- changelog.d/11244.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/11244.misc diff --git a/changelog.d/11244.misc b/changelog.d/11244.misc new file mode 100644 index 000000000000..61a8c0afd019 --- /dev/null +++ b/changelog.d/11244.misc @@ -0,0 +1 @@ +Rename MSC2716 related function to be more clear about the input and output (`get_insertion_event_id_by_batch_id`). From 88d1eab445740ee4b42682717999fd4adbd476ac Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 8 Nov 2021 12:16:58 -0600 Subject: [PATCH 3/3] Use same changelog so it dissolves into #11114 Fix https://github.com/matrix-org/synapse/pull/11244#discussion_r743154467 --- changelog.d/11244.misc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/11244.misc b/changelog.d/11244.misc index 61a8c0afd019..c6e65df97f90 100644 --- a/changelog.d/11244.misc +++ b/changelog.d/11244.misc @@ -1 +1 @@ -Rename MSC2716 related function to be more clear about the input and output (`get_insertion_event_id_by_batch_id`). +Fix [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) historical messages backfilling in random order on remote homeservers.