From 72c6165693d9c635bc8b158a7dc3592a3bd92789 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Wed, 18 Nov 2020 12:48:06 +0000 Subject: [PATCH] Update comment --- synapse/handlers/receipts.py | 3 ++- synapse/storage/databases/main/receipts.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/synapse/handlers/receipts.py b/synapse/handlers/receipts.py index c242c409cf26..153cbae7b912 100644 --- a/synapse/handlers/receipts.py +++ b/synapse/handlers/receipts.py @@ -158,7 +158,8 @@ async def get_new_events_as( if from_key == to_key: return [], to_key - # We first need to fetch all new receipts + # Fetch all read receipts for all rooms, up to a limit of 100. This is ordered + # by most recent. rooms_to_events = await self.store.get_linearized_receipts_for_all_rooms( from_key=from_key, to_key=to_key ) diff --git a/synapse/storage/databases/main/receipts.py b/synapse/storage/databases/main/receipts.py index 9ee7e46c22e3..1e7949a3233a 100644 --- a/synapse/storage/databases/main/receipts.py +++ b/synapse/storage/databases/main/receipts.py @@ -278,7 +278,8 @@ def f(txn): async def get_linearized_receipts_for_all_rooms( self, to_key: int, from_key: Optional[int] = None ) -> Dict[str, JsonDict]: - """Get receipts for all rooms between two stream_ids. + """Get receipts for all rooms between two stream_ids, up + to a limit of the latest 100 read receipts. Args: to_key: Max stream id to fetch receipts upto.