mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 21:44:48 -04:00
Ensure (room_id, next_batch_id)
is unique to avoid cross-talk/conflicts between batches (MSC2716) (#10877)
Part of [MSC2716](https://github.com/matrix-org/matrix-doc/pull/2716) Part of https://github.com/matrix-org/synapse/issues/10737
This commit is contained in:
parent
0f007fe009
commit
9fd057b8c5
4 changed files with 43 additions and 4 deletions
|
@ -18,7 +18,9 @@ from synapse.storage._base import SQLBaseStore
|
|||
|
||||
|
||||
class RoomBatchStore(SQLBaseStore):
|
||||
async def get_insertion_event_by_batch_id(self, batch_id: str) -> Optional[str]:
|
||||
async def get_insertion_event_by_batch_id(
|
||||
self, room_id: str, batch_id: str
|
||||
) -> Optional[str]:
|
||||
"""Retrieve a insertion event ID.
|
||||
|
||||
Args:
|
||||
|
@ -30,7 +32,7 @@ class RoomBatchStore(SQLBaseStore):
|
|||
"""
|
||||
return await self.db_pool.simple_select_one_onecol(
|
||||
table="insertion_events",
|
||||
keyvalues={"next_batch_id": batch_id},
|
||||
keyvalues={"room_id": room_id, "next_batch_id": batch_id},
|
||||
retcol="event_id",
|
||||
allow_none=True,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue