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

Skip calculating unread push actions in /sync when enable_push is false. #14980

Merged
merged 4 commits into from
Feb 14, 2023
Merged
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
Prev Previous commit
Next Next commit
Make singleton
  • Loading branch information
erikjohnston committed Feb 14, 2023
commit 5232c5849e3b7baaccf3ac9de4221046ad4d74fd
5 changes: 4 additions & 1 deletion synapse/storage/databases/main/event_push_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,16 @@ class RoomNotifCounts:

@staticmethod
def empty() -> "RoomNotifCounts":
return RoomNotifCounts(NotifCounts(), {})
return _EMPTY_ROOM_NOTIF_COUNTS

def __len__(self) -> int:
# To properly account for the amount of space in any caches.
return len(self.threads) + 1


_EMPTY_ROOM_NOTIF_COUNTS = RoomNotifCounts(NotifCounts(), {})


def _serialize_action(
actions: Collection[Union[Mapping, str]], is_highlight: bool
) -> str:
Expand Down