forked from MirrorHub/synapse
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`.
This commit is contained in:
parent
0dae7d80bf
commit
a55e2707d7
2 changed files with 7 additions and 1 deletions
1
changelog.d/8270.feature
Normal file
1
changelog.d/8270.feature
Normal file
|
@ -0,0 +1 @@
|
|||
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):
|
|||
|
||||
if row:
|
||||
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 {
|
||||
"notify_count": notif_count,
|
||||
|
|
Loading…
Reference in a new issue