synapse/changelog.d
Andrew Morgan 8bcfc2eaad
Be smarter about which hosts to send presence to when processing room joins (#9402)
This PR attempts to eliminate unnecessary presence sending work when your local server joins a room, or when a remote server joins a room your server is participating in by processing state deltas in chunks rather than individually.

---

When your server joins a room for the first time, it requests the historical state as well. This chunk of new state is passed to the presence handler which, after filtering that state down to only membership joins, will send presence updates to homeservers for each join processed.

It turns out that we were being a bit naive and processing each event individually, and sending out presence updates for every one of those joins. Even if many different joins were users on the same server (hello IRC bridges), we'd send presence to that same homeserver for every remote user join we saw.

This PR attempts to deduplicate all of that by processing the entire batch of state deltas at once, instead of only doing each join individually. We process the joins and note down which servers need which presence:

* If it was a local user join, send that user's latest presence to all servers in the room
* If it was a remote user join, send the presence for all local users in the room to that homeserver

We deduplicate by inserting all of those pending updates into a dictionary of the form:

```
{
  server_name1: {presence_update1, ...},
  server_name2: {presence_update1, presence_update2, ...}
}
```

Only after building this dict do we then start sending out presence updates.
2021-02-19 11:37:29 +00:00
..
.gitignore Correct attrs package name in requirements (#3492) 2018-07-07 10:46:59 +10:00
9003.misc Remove conflicting sqlite tables that are "reserved" (shadow fts4 tables) (#9003) 2021-02-10 20:12:57 +00:00
9123.misc Add experimental support for PyPy. (#9123) 2021-02-04 08:29:47 -05:00
9150.feature FIXUP: Now testing that the user is admin! 2021-01-28 12:31:07 +01:00
9203.feature Add configs to make profile data more private (#9203) 2021-02-19 09:50:41 +00:00
9240.misc Convert blacklisted IPv4 addresses to compatible IPv6 addresses. (#9240) 2021-02-03 07:13:46 -05:00
9257.bugfix Handle empty rooms when generating email notifications. (#9257) 2021-02-04 10:18:25 -05:00
9281.doc Reorganize CONTRIBUTING.md documentation. (#9281) 2021-02-17 11:23:57 -05:00
9291.doc config: Add detail to auto_join_rooms comment (#9291) 2021-02-03 15:21:30 +00:00
9296.bugfix Fix formatting for "bad session" error during sso registration flow (#9296) 2021-02-03 16:13:09 +00:00
9299.misc Update type hints for Cursor to match PEP 249. (#9299) 2021-02-05 15:39:19 -05:00
9300.feature social login: add noopener to terms link (#9300) 2021-02-02 18:35:28 +00:00
9301.feature Social login UI polish (#9301) 2021-02-03 20:31:23 +00:00
9305.misc Add debug logging to DNS SRV requests. (#9305) 2021-02-03 16:47:30 -05:00
9307.misc Add debug for OIDC flow (#9307) 2021-02-03 19:45:34 +00:00
9308.doc Correct matrix-synapse.service reference in TURN howto docs. (#9308) 2021-02-04 11:22:44 -05:00
9311.feature Add check_media_file_for_spam spam checker hook 2021-02-04 17:01:30 +00:00
9317.doc Fix escaping of braces in OIDC sample config. (#9317) 2021-02-04 09:06:20 -05:00
9321.bugfix Add type hints to groups code. (#9393) 2021-02-17 08:41:47 -05:00
9322.doc Update installation instructions on Fedora (#9322) 2021-02-05 14:20:38 +00:00
9326.misc Combine the CAS & SAML implementations for required attributes. (#9326) 2021-02-11 10:05:15 -05:00
9333.bugfix Handle additional errors when previewing URLs. (#9333) 2021-02-08 12:33:30 -05:00
9361.bugfix Remove unneeded type constraints on 3rd party protocol lookup responses 2021-02-09 17:50:25 +01:00
9362.misc Clean up caching/locking of OIDC metadata load (#9362) 2021-02-16 16:27:38 +00:00
9376.feature Support for form_post in OIDC responses (#9376) 2021-02-17 10:15:14 +00:00
9377.misc Convert some test cases to use HomeserverTestCase. (#9377) 2021-02-11 10:29:09 -05:00
9381.misc Update black, and run auto formatting over the codebase (#9381) 2021-02-16 22:32:34 +00:00
9383.feature Add a config option to prioritise local users in user directory search results (#9383) 2021-02-19 11:02:03 +00:00
9384.misc Allow OIDC config to override discovered values (#9384) 2021-02-16 22:33:09 +00:00
9390.doc Add http2 to the nginx example config (#9390) 2021-02-18 08:46:16 -05:00
9391.bugfix Ensure that we never stop reconnecting to redis (#9391) 2021-02-11 16:06:29 +00:00
9393.bugfix Add type hints to groups code. (#9393) 2021-02-17 08:41:47 -05:00
9394.misc Remove dead handled_events set in invite_join (#9394) 2021-02-12 22:15:50 +00:00
9395.bugfix Handle missing data in power levels events during room upgrade. (#9395) 2021-02-16 08:31:39 -05:00
9396.misc Convert additional test-cases to homeserver test case. (#9396) 2021-02-16 08:04:15 -05:00
9400.feature Add the shadow-banning status to the display user admin API. (#9400) 2021-02-17 15:19:23 -05:00
9402.bugfix Be smarter about which hosts to send presence to when processing room joins (#9402) 2021-02-19 11:37:29 +00:00
9404.doc Fix OIDC gitiea redirect URL. (#9404) 2021-02-16 14:06:55 -05:00
9407.doc Document that pusher instances are shardable (#9407) 2021-02-16 13:27:49 +00:00
9408.misc Remove dead notify_for_states presence method (#9408) 2021-02-17 17:32:26 +00:00
9421.bugfix Reduce the memory usage of previewing media files. (#9421) 2021-02-18 09:01:29 -05:00
9425.bugfix Fix only handling the last presence state for each user (#9425) 2021-02-17 17:31:37 +00:00
9426.bugfix Parse ui_auth.session_timeout as a duration (instead of treating it as ms) (#9426) 2021-02-18 09:18:14 -05:00
9428.bugfix Add back the guard against the user directory stream position not existing. (#9428) 2021-02-18 08:44:19 -05:00
9429.removal Deprecate old admin API GET /_synapse/admin/v1/users/<user_id> (#9429) 2021-02-18 09:05:41 -05:00
9433.docker Drop ARMv7 from docker (#9433) 2021-02-18 14:46:22 +00:00
9434.doc Remove deprecated SAML2 callback URL since it does not work. (#9434) 2021-02-18 11:20:33 -05:00