From 5a5cf6460ec4b4bb3a07813c36717b5a8d4a697c Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 17 Jun 2020 15:10:09 +0100 Subject: Fix unread counts in sync * Always return an unread_count in get_unread_event_push_actions_by_room_for_user * Don't always expect unread_count to be there so we don't take out sync entirely if something goes wrong --- synapse/push/push_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse/push/push_tools.py') diff --git a/synapse/push/push_tools.py b/synapse/push/push_tools.py index 9f264ca4a4..4ea683fee0 100644 --- a/synapse/push/push_tools.py +++ b/synapse/push/push_tools.py @@ -42,7 +42,7 @@ def get_badge_count(store, user_id): # We're populating this badge using the unread_count (instead of the # notify_count) as this badge is the number of missed messages, not the # number of missed notifications. - badge += 1 if notifs["unread_count"] else 0 + badge += 1 if notifs.get("unread_count") else 0 return badge -- cgit 1.5.1