Unread counts fixes (#8254)

* Fixup `ALTER TABLE` database queries

Make the new columns nullable, because doing otherwise can wedge a
server with a big database, as setting a default value rewrites the
table.

* Switch back to using the notifications count in the push badge

Clients are likely to be confused if we send a push but the badge count
is the unread messages one, and not the notifications one.

* Changelog
This commit is contained in:
Brendan Abolivier 2020-09-04 14:14:22 +01:00 committed by GitHub
parent db7de4d182
commit 041ee971c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -36,7 +36,7 @@ async def get_badge_count(store, user_id):
)
# return one badge count per conversation, as count per
# message is so noisy as to be almost useless
badge += 1 if notifs["unread_count"] else 0
badge += 1 if notifs["notify_count"] else 0
return badge