diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-12-15 10:41:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-15 10:41:34 -0500 |
commit | b3a4b53587108af7c58acc45a0441304689f3ac9 (patch) | |
tree | 6819625f82aac67a79203c16fb52aa13cb72a469 /synapse/push/httppusher.py | |
parent | Fix startup failure with localdb_enabled: False (#8937) (diff) | |
download | synapse-b3a4b53587108af7c58acc45a0441304689f3ac9.tar.xz |
Fix handling of stream tokens for push. (#8943)
Removes faulty assertions and fixes the logic to ensure the max stream token is always set.
Diffstat (limited to 'synapse/push/httppusher.py')
-rw-r--r-- | synapse/push/httppusher.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py index 5408aa1295..e8b25bcd2a 100644 --- a/synapse/push/httppusher.py +++ b/synapse/push/httppusher.py @@ -26,7 +26,6 @@ from synapse.events import EventBase from synapse.logging import opentracing from synapse.metrics.background_process_metrics import run_as_background_process from synapse.push import Pusher, PusherConfigException -from synapse.types import RoomStreamToken from . import push_rule_evaluator, push_tools @@ -122,17 +121,6 @@ class HttpPusher(Pusher): if should_check_for_notifs: self._start_processing() - def on_new_notifications(self, max_token: RoomStreamToken) -> None: - # We just use the minimum stream ordering and ignore the vector clock - # component. This is safe to do as long as we *always* ignore the vector - # clock components. - max_stream_ordering = max_token.stream - - self.max_stream_ordering = max( - max_stream_ordering, self.max_stream_ordering or 0 - ) - self._start_processing() - def on_new_receipts(self, min_stream_id: int, max_stream_id: int) -> None: # Note that the min here shouldn't be relied upon to be accurate. @@ -192,10 +180,7 @@ class HttpPusher(Pusher): Never call this directly: use _process which will only allow this to run once per pusher. """ - - fn = self.store.get_unread_push_actions_for_user_in_range_for_http - assert self.max_stream_ordering is not None - unprocessed = await fn( + unprocessed = await self.store.get_unread_push_actions_for_user_in_range_for_http( self.user_id, self.last_stream_ordering, self.max_stream_ordering ) |