- Feb 16, 2023
-
-
Patrick Cloke authored
This replaces the specific `is_room_mention` push rule condition used in MSC3952 with the generic `exact_event_match` push rule condition from MSC3758. No functionality changes due to this.
-
- Feb 14, 2023
-
-
Patrick Cloke authored
Adds a return type to HomeServerTestCase.make_homeserver and deal with any variables which are no longer Any.
-
Patrick Cloke authored
The `exact_event_property_contains` condition can be used to search for a value inside of an array.
-
reivilibre authored
-
- Feb 10, 2023
-
-
Mathieu Velten authored
Fixes #12801. Complement tests are at https://github.com/matrix-org/complement/pull/567 . Avoid blocking on full state when handling a subsequent join into a partial state room. Also always perform a remote join into partial state rooms, since we do not know whether the joining user has been banned and want to avoid leaking history to banned users. Signed-off-by:
Mathieu Velten <mathieuv@matrix.org> Co-authored-by:
Sean Quah <seanq@matrix.org> Co-authored-by:
David Robertson <davidr@element.io>
-
Sean Quah authored
It's important that collections returned from `@cached` methods are not modified, otherwise future retrievals from the cache will return the modified collection. This applies to the return values from `@cached` methods and the values inside the dictionaries returned by `@cachedList` methods. It's not necessary for the dictionaries returned by `@cachedList` methods themselves to be read-only. Signed-off-by:
Sean Quah <seanq@matrix.org> Co-authored-by:
David Robertson <davidr@element.io>
-
Patrick Cloke authored
This specifies to search for an exact value match, instead of string globbing. It only works across non-compound JSON values (null, boolean, integer, and strings).
-
- Feb 09, 2023
-
-
Shay authored
* 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>
-
Patrick Cloke authored
Respond with a 405 error if a request is received on a known endpoint, but to an unknown method, per MSC3743.
-
David Robertson authored
* -> None for test methods * A first batch of type fixes * Introduce common parent test case * Fixup that big test method * tests.module_api passes mypy * Changelog
-
- Feb 08, 2023
-
-
Patrick Cloke authored
-
Patrick Cloke authored
-
Patrick Cloke authored
This disambiguates keys which attempt to match fields with a dot in them (e.g. m.relates_to). Disabled by default behind an experimental configuration flag.
-
- Feb 07, 2023
-
-
David Robertson authored
* Fix MediaStorage type hint * Typecheck tests.rest.media.v1.test_media_storage * Changelog * Remove assert and make the comment succinct * Fix syntax for olddeps
-
David Robertson authored
* Proper types for tests.test_terms_auth * Changelog
-
Patrick Cloke authored
-
David Robertson authored
* Tweak http types in Synapse AFACIS these are correct, and they make mypy happier on tests.http. * Type hints for test_proxyagent * type hints for test_srv_resolver * test_matrix_federation_agent * tests.http.server._base * tests.http.__init__ * tests.http.test_additional_resource * tests.http.test_client * tests.http.test_endpoint * tests.http.test_matrixfederationclient * tests.http.test_servlet * tests.http.test_simple_client * tests.http.test_site * One fixup in tests.server * Untyped defs * Changelog * Fixup syntax for Python 3.7 * Fix olddeps syntax * Use a twisted IPv4 addr for dummy_address * Fix typo, thanks Sean Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com> * Remove redundant `Optional` --------- Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com>
-
- Feb 06, 2023
-
-
Patrick Cloke authored
-
David Robertson authored
* Make tests.federation pass mypy * Untyped defs in tests.federation.transport * test methods return None * Remaining type hints in tests.federation * Changelog * Avoid an uncessary type-ignore
-
Patrick Cloke authored
-
David Robertson authored
* Accept a Sequence of events in synapse.appservice This avoids some casts/ignores in the tests I'm about to fixup. It seems that `List[Mock]` is not a subtype of `List[EventBase]`, but `Sequence[Mock]` is a subtype of `Sequence[EventBase]`. So presumably `Mock` is considered a subtype of anything, much like `Any`. * make tests.appservice.test_scheduler pass mypy * Extra hints in tests.appservice.test_scheduler * Extra hints in tests.appservice.test_api * Extra hints in tests.appservice.test_appservice * Disallow untyped defs * Changelog
-
- Feb 03, 2023
-
-
David Robertson authored
-
Patrick Cloke authored
Co-authored-by:
Brad Murray <brad@beeper.com> Co-authored-by:
Nick Barrett <nick@beeper.com> Copy the suppress_edits push rule from Beeper to implement MSC3958. https://github.com/beeper/synapse/blame/9415a1284b1bfb558bd66f28c24ca1611e6c6fa2/rust/src/push/base_rules.rs#L98-L114
-
David Robertson authored
-
Patrick Cloke authored
-
Patrick Cloke authored
If the feature is enabled and the event has a `m.mentions` property, skip processing of the legacy mentions rules.
-
Sean Quah authored
Ensure that the list of servers in a partial state room always contains the server we joined off. Also refactor `get_partial_state_servers_at_join` to return `None` when the given room is no longer partial stated, to explicitly indicate when the room has partial state. Otherwise it's not clear whether an empty list means that the room has full state, or the room is partial stated, but the server we joined off told us that there are no servers in the room. Signed-off-by:
Sean Quah <seanq@matrix.org>
-
Patrick Cloke authored
Since pyo3-log is initialized very early in the Python start-up it caches the state of the loggers before they're fully initialized (and thus are essentially disabled). Whenever we reload the logging configuration we now also tell pyo3-log to discard any cached logging configuration it has; it will refetch the current logging configuration from Python at the next point it logs. This fixes Rust log lines not appearing in the homeserver logs.
-
- Feb 01, 2023
-
-
Patrick Cloke authored
The `parse_enum` helper pulls an enum value from the query string (by delegating down to the parse_string helper with values generated from the enum). This is used to pull out "f" and "b" in most places and then we thread the resulting Direction enum throughout more code.
-
Patrick Cloke authored
The previous assumption was that the stream_id column was unique (for a room ID, receipt type, user ID tuple), but this turned out to be incorrect. Now find the max stream ID, then map this back to a database-specific row identifier and delete other rows which match the (room ID, receipt type, user ID) tuple, but *not* the row ID.
-
Dirk Klimpel authored
* The user's profile information. * The user's devices. * The user's connections / IP address information.
-
- Jan 31, 2023
-
-
Sean Quah authored
#14910 fixed the regression introduced by #13873 where sqlite database migrations would no longer run inside a transaction. However, it committed the transaction before Synapse updated its bookkeeping of which migrations have been run, which means that migrations may be run again after they have completed successfully. Leave the transaction open at the end of `executescript`, to restore the old, correct behaviour. Also make the PostgreSQL behaviour consistent with SQLite. Fixes #14909. Signed-off-by:
Sean Quah <seanq@matrix.org>
-
- Jan 30, 2023
-
-
David Robertson authored
* Better test for bad values in power levels events The previous test only checked that Synapse didn't raise an exception, but didn't check that we had correctly interpreted the value of the dodgy power level. It also conflated two things: bad room notification levels, and bad user levels. There _is_ logic for converting the latter to integers, but we should test it separately. * Check we ignore types that don't convert to int * Handle `None` values in `notifications.room` * Changelog * Also test that bad values are rejected by event auth * Docstring * linter scripttttttttt
-
- Jan 27, 2023
-
-
Patrick Cloke authored
MSC3952 defines push rules which searches for mentions in a list of Matrix IDs in the event body, instead of searching the entire event body for display name / local part. This is implemented behind an experimental configuration flag and does not yet implement the backwards compatibility pieces of the MSC.
-
- Jan 26, 2023
-
-
Patrick Cloke authored
* FIx-up type hints in tests.logging. * Add missing type hints to test_transactions.
-
Andrew Morgan authored
-
- Jan 25, 2023
-
-
Patrick Cloke authored
-
Andrew Morgan authored
-
- Jan 23, 2023
-
-
David Robertson authored
* Allow `AbstractSet` in `StrCollection` Or else frozensets are excluded. This will be useful in an upcoming commit where I plan to change a function that accepts `List[str]` to accept `StrCollection` instead. * `rooms_to_exclude` -> `rooms_to_exclude_globally` I am about to make use of this exclusion mechanism to exclude rooms for a specific user and a specific sync. This rename helps to clarify the distinction between the global config and the rooms to exclude for a specific sync. * Better function names for internal sync methods * Track a list of excluded rooms on SyncResultBuilder I plan to feed a list of partially stated rooms for this sync to ignore * Exclude partial state rooms during eager sync using the mechanism established in the previous commit * Track un-partial-state stream in sync tokens So that we can work out which rooms have become fully-stated during a given sync period. * Fix mutation of `@cached` return value This was fouling up a complement test added alongside this PR. Excluding a room would mean the set of forgotten rooms in the cache would be extended. This means that room could be erroneously considered forgotten in the future. Introduced in #12310, Synapse 1.57.0. I don't think this had any user-visible side effects (until now). * SyncResultBuilder: track rooms to force as newly joined Similar plan as before. We've omitted rooms from certain sync responses; now we establish the mechanism to reintroduce them into future syncs. * Read new field, to present rooms as newly joined * Force un-partial-stated rooms to be newly-joined for eager incremental syncs only, provided they're still fully stated * Notify user stream listeners to wake up long polling syncs * Changelog * Typo fix Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com> * Unnecessary list cast Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com> * Rephrase comment Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com> * Another comment Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com> * Fixup merge(?) * Poke notifier when receiving un-partial-stated msg over replication * Fixup merge whoops Thanks MV :) Co-authored-by:
Mathieu Velen <mathieuv@matrix.org> Co-authored-by:
Mathieu Velten <mathieuv@matrix.org> Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com>
-
Patrick Cloke authored
* Skip processing stats for broken rooms. * Newsfragment * Use a custom exception.
-