From ad50510a06d035a674f0eeed5db5dd3060bc0b1c Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Thu, 18 May 2023 19:37:31 +0100 Subject: Handle missing previous read marker event. (#15464) If the previous read marker is pointing to an event that no longer exists (e.g. due to retention) then assume that the newly given read marker is newer. --- synapse/storage/databases/main/events_worker.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'synapse/storage') diff --git a/synapse/storage/databases/main/events_worker.py b/synapse/storage/databases/main/events_worker.py index 53aa5933d5..a39bc90974 100644 --- a/synapse/storage/databases/main/events_worker.py +++ b/synapse/storage/databases/main/events_worker.py @@ -1973,12 +1973,6 @@ class EventsWorkerStore(SQLBaseStore): return rows, to_token, True - async def is_event_after(self, event_id1: str, event_id2: str) -> bool: - """Returns True if event_id1 is after event_id2 in the stream""" - to_1, so_1 = await self.get_event_ordering(event_id1) - to_2, so_2 = await self.get_event_ordering(event_id2) - return (to_1, so_1) > (to_2, so_2) - @cached(max_entries=5000) async def get_event_ordering(self, event_id: str) -> Tuple[int, int]: res = await self.db_pool.simple_select_one( -- cgit 1.5.1