-
Notifications
You must be signed in to change notification settings - Fork 2
No read receipts in large rooms #67
base: beeper
Are you sure you want to change the base?
Conversation
f0f1137
to
fcd34c3
Compare
Whoops, we should actually remove this code, we're no longer using that type. |
20569b5
to
28780f8
Compare
28780f8
to
f74f4bf
Compare
synapse/handlers/receipts.py
Outdated
# so we convert messages to private, that are over RECEIPT_MAX_ROOM_SIZE. | ||
for i, r in enumerate(receipts): | ||
if r.receipt_type != ReceiptTypes.READ_PRIVATE: | ||
num_users = await self.store.get_number_joined_users_in_room(r.room_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we gather all of these ahead of time? Also a little clunky awaited on these one at a time, can we bulk grab these with twisted async somehow? @Fizzadar plz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this handles federation as well so there could be up to 100 read receipts here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to ensure we only check the size of each room once beeper/synapse@fbcd582
But would be great to hear if anyone knows how to do the equivalent of asyncio.gather
in twisted, I haven't found it myself yet....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s a gatherResults
that roughly does the same!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I'll check that out when I next get a chance to work on this. thanks @Fizzadar
@Fizzadar This is ready to go so feel free to merge. But if you would like a warranty with it (i.e. me to monitor it) then you'll need to wait till I join (start of May). Up to you.... |
Overview
Prevents read receipts being sent when rooms are over a defined size, whilst preserving the behaviour of read/unread notifications. This has been achieved by converting receipts types to be private when the room size is large, as this is the simplest method I've found to decouple ephemeral receipt notification and read/unread notifications.