mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-24 05:19:22 -05:00
Merge pull request #3235 from matrix-org/rav/fix_receipts_deferred
Fix error in handling receipts
This commit is contained in:
commit
ed3125b0a1
@ -297,15 +297,19 @@ class ReceiptsWorkerStore(SQLBaseStore):
|
||||
if receipt_type != "m.read":
|
||||
return
|
||||
|
||||
# Returns an ObservableDeferred
|
||||
# Returns either an ObservableDeferred or the raw result
|
||||
res = self.get_users_with_read_receipts_in_room.cache.get(
|
||||
room_id, None, update_metrics=False,
|
||||
)
|
||||
|
||||
if res:
|
||||
if isinstance(res, defer.Deferred) and res.called:
|
||||
# first handle the Deferred case
|
||||
if isinstance(res, defer.Deferred):
|
||||
if res.called:
|
||||
res = res.result
|
||||
if user_id in res:
|
||||
else:
|
||||
res = None
|
||||
|
||||
if res and user_id in res:
|
||||
# We'd only be adding to the set, so no point invalidating if the
|
||||
# user is already there
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user