summary refs log tree commit diff
path: root/tests/events/test_utils.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add `event.internal_metadata.instance_name` (#17300)Eric Eastwood2024-06-131-0/+3
| | | | | | | | | | Add `event.internal_metadata.instance_name` (the worker instance that persisted the event) to go alongside the existing `event.internal_metadata.stream_ordering`. `instance_name` is useful to properly compare and query for events with a token since you need to compare both the `stream_ordering` and `instance_name` against the vector clock/`instance_map` in the `RoomStreamToken`. This is pre-requisite work and may be used in https://github.com/element-hq/synapse/pull/17293 Adding `event.internal_metadata.instance_name` was first mentioned in the initial Sliding Sync PR while pairing with @erikjohnston, see https://github.com/element-hq/synapse/pull/17187/commits/09609cb0dbca3a4cfd9fbf90cc962e765ec469c0#diff-5cd773fb307aa754bd3948871ba118b1ef0303f4d72d42a2d21e38242bf4e096R405-R410
* Add support for MSC4115 (#17104)Richard van der Hoff2024-04-291-0/+24
| | | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Properly handle redactions of creation events (#15973)Shay2023-07-231-2/+7
|
* Support room version 11 (#15912)Patrick Cloke2023-07-181-16/+14
| | | | | And fix a bug in the implementation of the updated redaction format (MSC2174) where the top-level redacts field was not properly added for backwards-compatibility.
* Properly parse event_fields in filters (#15607)Patrick Cloke2023-05-221-0/+39
| | | | | | | | The event_fields property in filters should use the proper escape rules, namely backslashes can be escaped with an additional backslash. This adds tests (adapted from matrix-js-sdk) and implements the logic to properly split the event_fields strings.
* Implement MSC3821 to update redaction rules (`third_party_invite.signed`) ↵Patrick Cloke2023-05-151-1/+74
| | | | | | (#15563) Updates the redaction rules to protect enough information that the event can still be properly verified.
* Implement MSC3389 to protect relations from redaction. (#15565)Patrick Cloke2023-05-151-0/+90
| | | | | | MSC3389 proposes protecting the relation type & parent event ID from redaction. This keeps the relation information intact after redaction which helps with some UX flaws (e.g. deleting an event causes it to no longer be in a thread, which is confusing).
* Implement MSC2174: move redacts to a content property. (#15395)Patrick Cloke2023-04-131-2/+10
| | | | | | | This moves `redacts` from being a top-level property to a `content` property in a new room version. MSC2176 (which was previously implemented) states to not `redact` this property.
* Implement MSC3989 to redact the origin field. (#15393)Patrick Cloke2023-04-051-0/+7
| | | | This will be done in a future room version, for now an unstable room version is added which redacts the origin field.
* Properly typecheck tests.api (#14983)David Robertson2023-02-031-0/+2
|
* Add missing type hints for tests.events. (#14904)Patrick Cloke2023-01-251-33/+38
|
* Allow selecting "prejoin" events by state keys (#14642)David Robertson2022-12-131-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Convert stringy power levels to integers on room upgrade (#12657)David Robertson2022-05-071-2/+39
|
* Use the proper serialization format when bundling aggregations. (#12090)Patrick Cloke2022-03-031-1/+4
| | | | This ensures that the `latest_event` field of the bundled aggregation for threads uses the same format as the other events in the response.
* Replace assertEquals and friends with non-deprecated versions. (#12092)Patrick Cloke2022-02-281-8/+8
|
* Strip "join_authorised_via_users_server" from join events which do not need ↵Patrick Cloke2021-09-301-3/+4
| | | | | | | it. (#10933) This fixes a "Event not signed by authorising server" error when transition room member from join -> join, e.g. when updating a display name or avatar URL for restricted rooms.
* Support MSC3375: room version 9. (#10747)Patrick Cloke2021-09-031-1/+45
|
* Support MSC3289: Room version 8 (#10449)Patrick Cloke2021-08-091-1/+1
| | | This adds support for MSC3289: room version 8. This is room version 7 + MSC3083.
* Restricted rooms (MSC3083) should not have their allow key redacted. (#10489)Patrick Cloke2021-07-281-0/+43
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Implement MSC2176: Updated redaction rules (#8984)Patrick Cloke2021-01-051-21/+164
| | | | An experimental room version ("org.matrix.msc2176") contains the new redaction rules for testing.
* Implement room version 6 (MSC2240). (#7506)Patrick Cloke2020-05-151-1/+1
|
* Remove special auth and redaction rules for aliases events in experimental ↵Patrick Cloke2020-03-091-2/+33
| | | | room ver. (#7037)
* Add a `make_event_from_dict` method (#6858)Richard van der Hoff2020-02-071-4/+5
| | | | | | | ... and use it in places where it's trivial to do so. This will make it easier to pass room versions into the FrozenEvent constructors.
* Factor out a `copy_power_levels_contents` methodRichard van der Hoff2020-01-291-2/+43
| | | | I'm going to need another copy (hah!) of this.
* Run Black. (#5482)Amber Brown2019-06-201-47/+47
|
* Fix a number of flake8 errorsRichard van der Hoff2018-10-241-2/+2
| | | | | | | | | | | | Broadly three things here: * disable W504 which seems a bit whacko * remove a bunch of `as e` expressions from exception handlers that don't use them * use `r""` for strings which include backslashes Also, we don't use pep8 any more, so we can get rid of the duplicate config there.
* Run black.black2018-08-101-98/+37
|
* run isortAmber Brown2018-07-091-2/+2
|
* Optimise state resolutionErik Johnston2017-01-171-1/+21
|
* Review commentsKegan Dougal2016-11-221-10/+2
|
* More testsKegan Dougal2016-11-221-1/+56
|
* Add remaining testsKegan Dougal2016-11-211-4/+70
|
* Start adding some testsKegan Dougal2016-11-211-3/+37
|
* Move event_fields filtering to serialize_eventKegan Dougal2016-11-211-0/+21
| | | | Also make it an inclusive not exclusive filter, as the spec demands.
* Fix flake8 warnings for testsMark Haines2016-02-191-0/+1
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Add some unit tests of prune_events()Paul "LeoNerd" Evans2015-10-161-0/+115