Shay
03bccd542b
Add a class UnpersistedEventContext to allow for the batching up of storing state groups ( #14675 )
* add class UnpersistedEventContext
* modify create new client event to create unpersistedeventcontexts
* persist event contexts after creation
* fix tests to persist unpersisted event contexts
* cleanup
* misc lints + cleanup
* changelog + fix comments
* lints
* fix batch insertion?
* reduce redundant calculation
* add unpersisted event classes
* rework compute_event_context, split into function that returns unpersisted event context and then persists it
* use calculate_context_info to create unpersisted event contexts
* update typing
* $%#^&*
* black
* fix comments and consolidate classes, use attr.s for class
* requested changes
* lint
* requested changes
* requested changes
* refactor to be stupidly explicit
* clearer renaming and flow
* make partial state non-optional
* update docstrings
---------
Co-authored-by: Erik Johnston <erik@matrix.org>
1 year ago
Patrick Cloke
3ac412b4e2
Require types in tests.storage. ( #14646 )
Adds missing type hints to `tests.storage` package
and does not allow untyped definitions.
1 year ago
Erik Johnston
1e453053cb
Rename storage classes ( #12913 )
2 years ago
Richard van der Hoff
33ebee47e4
Remove redundant `get_success` calls in test code ( #12346 )
There are a bunch of places we call get_success on an immediate value, which is unnecessary. Let's rip them out, and remove the redundant functionality in get_success and friends.
2 years ago
Richard van der Hoff
e24ff8ebe3
Remove `HomeServer.get_datastore()` ( #12031 )
The presence of this method was confusing, and mostly present for backwards
compatibility. Let's get rid of it.
Part of #11733
2 years ago
Patrick Cloke
228decfce1
Update the MSC3083 support to verify if joins are from an authorized server. ( #10254 )
2 years ago
Eric Eastwood
96f6293de5
Add endpoints for backfilling history (MSC2716) ( #9247 )
Work on https://github.com/matrix-org/matrix-doc/pull/2716
3 years ago
Jonathan de Jong
4b965c862d
Remove redundant "coding: utf-8" lines ( #9786 )
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>`
3 years ago
Jonathan de Jong
2ca4e349e9
Bugbear: Add Mutable Parameter fixes ( #9682 )
Part of #9366
Adds in fixes for B006 and B008, both relating to mutable parameter lint errors.
Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>
3 years ago
Patrick Cloke
e7b769aea1
Convert storage test cases to HomeserverTestCase. ( #9736 )
3 years ago
Eric Eastwood
0a00b7ff14
Update black, and run auto formatting over the codebase ( #9381 )
- Update black version to the latest
- Run black auto formatting over the codebase
- Run autoformatting according to [`docs/code_style.md
`](80d6dc9783/docs/code_style.md)
- Update `code_style.md` docs around installing black to use the correct version
3 years ago
Richard van der Hoff
90cf1eec44
Remove redundant mocking
3 years ago
Patrick Cloke
30fba62108
Apply an IP range blacklist to push and key revocation requests. ( #8821 )
Replaces the `federation_ip_range_blacklist` configuration setting with an
`ip_range_blacklist` setting with wider scope. It now applies to:
* Federation
* Identity servers
* Push notifications
* Checking key validitity for third-party invite events
The old `federation_ip_range_blacklist` setting is still honored if present, but
with reduced scope (it only applies to federation and identity servers).
3 years ago
Richard van der Hoff
a34b17e492
Simplify `_locally_reject_invite`
Update `EventCreationHandler.create_event` to accept an auth_events param, and
use it in `_locally_reject_invite` instead of reinventing the wheel.
3 years ago
Richard van der Hoff
fcbab08cbd
Add an assertion on prev_events in create_new_client_event ( #8041 )
I think this would have caught all the cases in
https://github.com/matrix-org/synapse/issues/7642 - and I think a 500 makes
more sense here than a 403
3 years ago
Erik Johnston
a7bdf98d01
Rename database classes to make some sense ( #8033 )
3 years ago
Patrick Cloke
8553f46498
Convert a synapse.events to async/await. ( #7949 )
3 years ago
Richard van der Hoff
43b2be9764
Replace _event_dict_property with DictProperty
this amounts to the same thing, but replaces `_event_dict` with `_dict`, and
removes some of the function layers generated by `property`.
4 years ago
Erik Johnston
b9391c9575
Add typing to SyncHandler ( #6821 )
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
4 years ago
Erik Johnston
fa4d609e20
Make 'event.redacts' never raise. ( #6771 )
There are quite a few places that we assume that a redaction event has a
corresponding `redacts` key, which is not always the case. So lets
cheekily make it so that event.redacts just returns None instead.
4 years ago
Erik Johnston
756d4942f5
Move DB pool and helper functions into dedicated Database class
4 years ago
Erik Johnston
ee86abb2d6
Remove underscore from SQLBaseStore functions
4 years ago
Erik Johnston
3ca4c7c516
Use new EventPersistenceStore
4 years ago
Erik Johnston
ce7a3e7e27
Fix fetching censored redactions from DB
Fetching a censored redactions caused an exception due to the code
expecting redactions to have a `redact` key, which redacted redactions
don't have.
4 years ago
Erik Johnston
ad9b64b496
Fix test
4 years ago
Erik Johnston
3ff0422d2d
Make redaction retention period configurable
4 years ago
Erik Johnston
a4bf72c30c
Censor redactions in DB after a month
4 years ago
Richard van der Hoff
4e97eb89e5
Handle loops in redaction events
4 years ago
Richard van der Hoff
1cad8d7b6f
Convert RedactionTestCase to modern test style ( #5768 )
4 years ago
Amber Brown
4806651744
Replace returnValue with return ( #5736 )
4 years ago
Amber Brown
32e7c9e7f2
Run Black. ( #5482 )
5 years ago
Amber Brown
b36c82576e
Run Black on the tests again ( #5170 )
5 years ago
Richard van der Hoff
54a87a7b08
Collect room-version variations into one place ( #4969 )
Collect all the things that make room-versions different to one another into
one place, so that it's easier to define new room versions.
5 years ago
Erik Johnston
9770ed91c2
Fix tests
5 years ago
Erik Johnston
be6a7e47fa
Revert "Require event format version to parse or create events"
5 years ago
Erik Johnston
e79ba9eb34
Fix tests
5 years ago
Amber Brown
99dd975dae
Run tests under PostgreSQL ( #3423 )
5 years ago
black
8b3d9b6b19
Run black.
5 years ago
Erik Johnston
3e19beb941
Fix tests
5 years ago
Amber Brown
49af402019
run isort
6 years ago
Erik Johnston
770b2252ca
s/_create_new_client_event/create_new_client_event/
6 years ago
Erik Johnston
25c0a020f4
Updates tests
6 years ago
Mark Haines
7e2f971c08
Remove some unused functions ( #711 )
* Remove some unused functions
* get_room_events_stream is only used in tests
* is_exclusive_room might actually be something we want
8 years ago
Matthew Hodgson
6c28ac260c
copyrights
8 years ago
Daniel Wagner-Hall
771ca56c88
Remove more unused parameters
8 years ago
Mark Haines
896253e085
Factor out some of the common homeserver setup code into a
setup_test_homeserver function in utils.
9 years ago
Mark Haines
1c06c48ce2
Replace hs.parse_roomid with RoomID.from_string
9 years ago
Mark Haines
5759bec43c
Replace hs.parse_userid with UserID.from_string
9 years ago
Erik Johnston
3c77d13aa5
Kill off synapse.api.events.*
9 years ago
Erik Johnston
e72b16f9a3
Fix redaction tests
9 years ago