synapse/tests/federation
Erik Johnston 3943d2fde7
Fix up logic for delaying sending read receipts over federation. (#17933)
For context of why we delay read receipts, see
https://github.com/matrix-org/synapse/issues/4730.

Element Web often sends read receipts in quick succession, if it reloads
the timeline it'll send one for the last message in the old timeline and
again for the last message in the new timeline. This caused remote users
to see a read receipt for older messages come through quickly, but then
the second read receipt taking a while to arrive for the most recent
message.

There are two things going on in this PR:
1. There was a mismatch between seconds and milliseconds, and so we
ended up delaying for far longer than intended.
2. Changing the logic to reuse the `DestinationWakeupQueue` (used for
presence)

The changes in logic are:
- Treat the first receipt and subsequent receipts in a room in the same
way
- Whitelist certain classes of receipts to never delay being sent, i.e.
receipts in small rooms, receipts for events that were sent within the
last 60s, and sending receipts to the event sender's server.
- The maximum delay a receipt can have before being sent to a server is
30s, and we'll send out receipts to remotes at least at 50Hz (by
default)

The upshot is that this should make receipts feel more snappy over
federation.

This new logic should send roughly between 10%–20% of transactions
immediately on matrix.org.
2024-11-25 18:12:33 +00:00
..
transport Optional whitespace support in Authorization (#1350) (#17145) 2024-05-08 13:56:16 +00:00
__init__.py Implementation of server_acls 2018-07-04 19:06:20 +01:00
test_complexity.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_federation_catch_up.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_federation_client.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_federation_media.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_federation_sender.py Fix up logic for delaying sending read receipts over federation. (#17933) 2024-11-25 18:12:33 +00:00
test_federation_server.py Ensure that incoming to-device messages are not dropped (#17127) 2024-04-29 14:11:00 +01:00