* 'develop' of github.com:matrix-org/synapse: (75 commits)
Add instance name to RDATA/POSITION commands (#7364)
Don't relay REMOTE_SERVER_UP cmds to same conn. (#7352)
Fix limit logic for EventsStream (#7358)
Fix fallback value for account_threepid_delegates.email (#7316)
Clean up admin api docs (#7361)
Return total number of users and profile attributes in admin users endpoint (#6881)
Add some replication tests (#7278)
Fix typo 'datbases' in ConfigError
Fix collation for postgres for unit tests (#7359)
Run replication streamers on workers (#7146)
Fix incorrect metrics reporting for renew_attestations (#7344)
Document monitoring workers (#7357)
Add some explanation to application_services.md (#7091)
Don't crash when one of the configuration files is empty (#7341)
Add documentation to the sample config about the templates for SSO. (#7343)
Convert some of the federation handler methods to async/await. (#7338)
changelog
Fix EventsStream raising assertions when it falls behind
1.12.4
Make it clear that the limit for an update_function is a target
...
Long story short: if we're handling presence on the current worker, we shouldn't be sending USER_SYNC commands over replication.
In an attempt to figure out what is going on here, I ended up refactoring some bits of the presencehandler code, so the first 4 commits here are non-functional refactors to move this code slightly closer to sanity. (There's still plenty to do here :/). Suggest reviewing individual commits.
Fixes (I hope) #7257.
... and set it everywhere it's called.
while we're here, rename it for consistency with `check_user_in_room` (and to
help check that I haven't missed any instances)
We were looking at the wrong event type (`m.room.encryption` vs
`m.room.encrypted`).
Also fixup the duplicate `EvenTypes` entries.
Introduced in #6776.
These are easier to work with than the strings and we normally have one around.
This fixes `FederationHander._persist_auth_tree` which was passing a
RoomVersion object into event_auth.check instead of a string.
Previously we tried to be clever and filter out some unnecessary event
IDs to keep the auth chain small, but that had some annoying
interactions with state res v2 so we stop doing that for now.
Implement part [MSC2228](https://github.com/matrix-org/matrix-doc/pull/2228). The parts that differ are:
* the feature is hidden behind a configuration flag (`enable_ephemeral_messages`)
* self-destruction doesn't happen for state events
* only implement support for the `m.self_destruct_after` field (not the `m.self_destruct` one)
* doesn't send synthetic redactions to clients because for this specific case we consider the clients to be able to destroy an event themselves, instead we just censor it (by pruning its JSON) in the database
We don't actually care about what happens in `get_user_by_req` and
having it as a separate span means that the entity tag isn't added to
the servlet spans, making it harder to search.
This allows support users to be created even on MAU limits via
the admin API. Support users are excluded from MAU after creation,
so it makes sense to exclude them in creation - except if the
whole host is in disabled state.
Signed-off-by: Jason Robinson <jasonr@matrix.org>
Remove all the "double return" statements which were a result of us removing all the instances of
```
defer.returnValue(...)
return
```
statements when we switched to python3 fully.
Python will return a tuple whether there are parentheses around the returned values or not.
I'm just sick of my editor complaining about this all over the place :)