mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-04 11:17:51 +00:00
Assert that the pruning position is known instead of faking an infinite one
This commit is contained in:
1 file changed
+2
-7
@@ -80,7 +80,6 @@ receipt.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
@@ -363,12 +362,8 @@ class EventPushActionsWorkerStore(ReceiptsWorkerStore, StreamWorkerStore, SQLBas
|
||||
elsewhere here -- a summary row trusted for up to one rotation cycle longer
|
||||
than it strictly had to be -- so being approximate is fine.
|
||||
"""
|
||||
if self.stream_ordering_day_ago is None:
|
||||
# `stream_ordering_day_ago` is populated synchronously in `__init__`, so
|
||||
# in practice this doesn't happen; if it somehow did we'd rather never
|
||||
# prefer `event_push_actions` over the summary.
|
||||
return sys.maxsize
|
||||
|
||||
# Populated synchronously in `__init__`.
|
||||
assert self.stream_ordering_day_ago is not None
|
||||
return self.stream_ordering_day_ago
|
||||
|
||||
async def get_unread_counts_by_room_for_user(self, user_id: str) -> dict[str, int]:
|
||||
|
||||
Reference in new issue
Block a user