mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-24 19:25:57 +00:00
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
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,6 +177,11 @@ class EventPushActionsWorkerStore(SQLBaseStore):
|
|||||||
|
|
||||||
if row:
|
if row:
|
||||||
notif_count += row[0]
|
notif_count += row[0]
|
||||||
|
|
||||||
|
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]
|
unread_count += row[1]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user