Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix handling of stream tokens for push #8943

Merged
merged 5 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8943.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add type hints to push module.
1 change: 0 additions & 1 deletion synapse/push/emailpusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ async def _unsafe_process(self) -> None:
being run.
"""
start = 0 if INCLUDE_ALL_UNREAD_NOTIFS else self.last_stream_ordering
assert self.max_stream_ordering is not None
unprocessed = await self.store.get_unread_push_actions_for_user_in_range_for_email(
self.user_id, start, self.max_stream_ordering
)
Expand Down
5 changes: 1 addition & 4 deletions synapse/push/httppusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,7 @@ async def _unsafe_process(self) -> None:
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
)

Expand Down
4 changes: 2 additions & 2 deletions synapse/storage/databases/main/event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ async def get_unread_push_actions_for_user_in_range_for_http(
self,
user_id: str,
min_stream_ordering: int,
max_stream_ordering: int,
max_stream_ordering: Optional[int],
limit: int = 20,
) -> List[dict]:
"""Get a list of the most recent unread push actions for a given user,
Expand Down Expand Up @@ -314,7 +314,7 @@ async def get_unread_push_actions_for_user_in_range_for_email(
self,
user_id: str,
min_stream_ordering: int,
max_stream_ordering: int,
max_stream_ordering: Optional[int],
limit: int = 20,
) -> List[dict]:
"""Get a list of the most recent unread push actions for a given user,
Expand Down