MatrixSynapse/synapse/events
David Robertson e2a1adbf5d
Allow selecting "prejoin" events by state keys (#14642)
* Declare new config

* Parse new config

* Read new config

* Don't use trial/our TestCase where it's not needed

Before:

```
$ time trial tests/events/test_utils.py > /dev/null

real	0m2.277s
user	0m2.186s
sys	0m0.083s
```

After:
```
$ time trial tests/events/test_utils.py > /dev/null

real	0m0.566s
user	0m0.508s
sys	0m0.056s
```

* Helper to upsert to event fields

without exceeding size limits.

* Use helper when adding invite/knock state

Now that we allow admins to include events in prejoin room state with
arbitrary state keys, be a good Matrix citizen and ensure they don't
accidentally create an oversized event.

* Changelog

* Move StateFilter tests

should have done this in #14668

* Add extra methods to StateFilter

* Use StateFilter

* Ensure test file enforces typed defs; alphabetise

* Workaround surprising get_current_state_ids

* Whoops, fix mypy
2022-12-13 00:54:46 +00:00
..
__init__.py Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00
builder.py Move `StateFilter` to `synapse.types` (#14668) 2022-12-12 16:19:30 +00:00
presence_router.py Implement cancellation support/protection for module callbacks (#12568) 2022-05-09 12:31:14 +01:00
snapshot.py Move `StateFilter` to `synapse.types` (#14668) 2022-12-12 16:19:30 +00:00
spamcheck.py Instrument `_check_sigs_and_hash_and_fetch` to trace time spent in child concurrent calls (#13588) 2022-08-23 21:53:37 -05:00
third_party_rules.py Make `_get_state_map_for_room` not break when room state events don't contain an event id. (#13174) 2022-07-07 08:14:32 +00:00
utils.py Allow selecting "prejoin" events by state keys (#14642) 2022-12-13 00:54:46 +00:00
validator.py Rename the `EventFormatVersions` enum values so that they line up with room version numbers. (#13706) 2022-09-07 11:08:20 +01:00