Skip to content
Snippets Groups Projects
Unverified Commit a55e2707 authored by Brendan Abolivier's avatar Brendan Abolivier Committed by GitHub
Browse files

Fix unread count failing on NULL values (#8270)

Fix unread counts making sync fail if the value of the `unread_count`
column in `event_push_summary` is `None`.
parent 0dae7d80
No related branches found
No related tags found
No related merge requests found
Add unread messages count to sync responses, as specified in [MSC2654](https://github.com/matrix-org/matrix-doc/pull/2654).
...@@ -177,7 +177,12 @@ class EventPushActionsWorkerStore(SQLBaseStore): ...@@ -177,7 +177,12 @@ class EventPushActionsWorkerStore(SQLBaseStore):
if row: if row:
notif_count += row[0] notif_count += row[0]
unread_count += row[1]
if row[1] is not None:
# The unread_count column of event_push_summary is NULLable, so we need
# to make sure we don't try increasing the unread counts if it's NULL
# for this row.
unread_count += row[1]
return { return {
"notify_count": notif_count, "notify_count": notif_count,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment