Преглед на файлове

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`.
tags/v1.20.0rc1
Brendan Abolivier преди 3 години
committed by GitHub
родител
ревизия
a55e2707d7
No known key found for this signature in database GPG ключ ID: 4AEE18F83AFDEB23
променени са 2 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. +1
    -0
      changelog.d/8270.feature
  2. +6
    -1
      synapse/storage/databases/main/event_push_actions.py

+ 1
- 0
changelog.d/8270.feature Целия файл

@@ -0,0 +1 @@
Add unread messages count to sync responses, as specified in [MSC2654](https://github.com/matrix-org/matrix-doc/pull/2654).

+ 6
- 1
synapse/storage/databases/main/event_push_actions.py Целия файл

@@ -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,


Зареждане…
Отказ
Запис