summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorŠimon Brandner <simon.bra.ag@gmail.com>2021-08-16 13:22:38 +0200
committerAndrew Morgan <andrew@amorgan.xyz>2021-08-16 12:23:15 +0100
commit40e92b224c827500bb9c9400d2896e572aa61ea6 (patch)
treeb233fecabc0be43b782c06efc0be08e6f513c1c2 /synapse
parentMerge branch 'release-v1.40' of github.com:matrix-org/synapse into matrix-org... (diff)
downloadsynapse-40e92b224c827500bb9c9400d2896e572aa61ea6.tar.xz
Handle string read receipt data (#10606)
* Handle string read receipt data

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Test that we handle string read receipt data

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Add changelog for #10606

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Add docs

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Ignore malformed RRs

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Only surround hidden = ...

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Remove unnecessary argument

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Update changelog.d/10606.bugfix

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/receipts.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/handlers/receipts.py b/synapse/handlers/receipts.py

index b9085bbccb..40e0c7bb1b 100644 --- a/synapse/handlers/receipts.py +++ b/synapse/handlers/receipts.py
@@ -187,7 +187,14 @@ class ReceiptEventSource: new_users = {} for rr_user_id, user_rr in m_read.items(): - hidden = user_rr.get("hidden", None) + try: + hidden = user_rr.get("hidden") + except AttributeError: + # Due to https://github.com/matrix-org/synapse/issues/10376 + # there are cases where user_rr is a string, in those cases + # we just ignore the read receipt + continue + if hidden is not True or rr_user_id == user_id: new_users[rr_user_id] = user_rr.copy() # If hidden has a value replace hidden with the correct prefixed key