- Sep 24, 2021
-
-
Patrick Cloke authored
-
Richard van der Hoff authored
* Factor more stuff out of `_get_events_and_persist` It turns out that the event-sorting algorithm in `_get_events_and_persist` is also useful in other circumstances. Here we move the current `_auth_and_persist_fetched_events` to `_auth_and_persist_fetched_events_inner`, and then factor the sorting part out to `_auth_and_persist_fetched_events`. * `_get_remote_auth_chain_for_event`: remove redundant `outlier` assignment `get_event_auth` returns events with the outlier flag already set, so this is redundant (though we need to update a test where `get_event_auth` is mocked). * `_get_remote_auth_chain_for_event`: move existing-event tests earlier Move a couple of tests outside the loop. This is a bit inefficient for now, but a future commit will make it better. It should be functionally identical. * `_get_remote_auth_chain_for_event`: use `_auth_and_persist_fetched_events` We can use the same codepath for persisting the events fetched as part of an auth chain as for those fetched individually by `_get_events_and_persist` for building the state at a backwards extremity. * `_get_remote_auth_chain_for_event`: use a dict for efficiency `_auth_and_persist_fetched_events` sorts the events itself, so we no longer need to care about maintaining the ordering from `get_event_auth` (and no longer need to sort by depth in `get_event_auth`). That means that we can use a map, making it easier to filter out events we already have, etc. * changelog * `_auth_and_persist_fetched_events`: improve docstring
-
Erik Johnston authored
-
Jason Robinson authored
If the MAU count had been reached, Synapse incorrectly blocked appservice users even though they've been explicitly configured not to be tracked (the default). This was due to bypassing the relevant if as it was chained behind another earlier hit if as an elif. Signed-off-by:
Jason Robinson <jasonr@matrix.org>
-
David Robertson authored
* Improve typing in user_directory files This makes the user_directory.py in storage pass most of mypy's checks (including `no-untyped-defs`). Unfortunately that file is in the tangled web of Store class inheritance so doesn't pass mypy at the moment. The handlers directory has already been mypyed. Co-authored-by:
reivilibre <olivier@librepush.net>
-
- Sep 23, 2021
-
-
Callum Brown authored
Per updates to MSC3231 in order to use the same grammar as other identifiers.
-
Patrick Cloke authored
-
David Robertson authored
Co-authored-by:
Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Co-authored-by:
reivilibre <olivier@librepush.net> Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-
Patrick Cloke authored
This avoids the overhead of searching through the various configuration classes by directly referencing the class that the attributes are in. It also improves type hints since mypy can now resolve the types of the configuration variables.
-
Andrew Morgan authored
-
- Sep 22, 2021
-
-
Hillery Shay authored
* add test to check if null code points are being inserted * add logic to detect and replace null code points before insertion into db * lints * add license to test * change approach to null substitution * add type hint for SearchEntry * Add changelog entry Signed-off-by:
H.Shay <shaysquared@gmail.com> * updated changelog * update chanelog message * remove duplicate changelog * Update synapse/storage/databases/main/events.py remove extra space Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com> * rename and move test file, update tests, delete old test file * fix typo in comments * update _find_highlights_in_postgres to replace null byte with space * replace null byte in sqlite search insertion * beef up and reorganize test for this pr * update changelog * add type hints and update docstring * check db engine directly vs using env variable * refactor tests to be less repetetive * move rplace logic into seperate function * requested changes * Fix typo. * Update synapse/storage/databases/main/search.py Co-authored-by:
reivilibre <olivier@librepush.net> * Update changelog.d/10820.misc Co-authored-by:
Aaron Raimist <aaron@raim.ist> Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by:
reivilibre <olivier@librepush.net> Co-authored-by:
Aaron Raimist <aaron@raim.ist>
-
Patrick Cloke authored
* Improved titles (fall back to the author name if there's not title) and include the site name. * Handle photo/video payloads. * Include the original URL in the Open Graph response. * Fix the expiration time (by properly converting from seconds to milliseconds).
-
David Teller authored
Extend ModuleApi with the methods we'll need to reject spam based on IP - resolves #10832 Signed-off-by:
David Teller <davidt@element.io>
-
- Sep 21, 2021
-
-
Patrick Cloke authored
-
Patrick Cloke authored
The major change is moving the decision of whether to use oEmbed further up the call-stack. This reverts the _download_url method to being a "dumb" functionwhich takes a single URL and downloads it (as it was before #7920). This also makes more minor refactorings: * Renames internal variables for clarity. * Factors out shared code between the HTML and rich oEmbed previews. * Fixes tests to preview an oEmbed image.
-
Brendan Abolivier authored
Test for #10830 Ideally the test would also make sure the new state event comes down sync, but this is probably good enough.
-
Hillery Shay authored
* add tests for checking if room search works with non-ascii char * change encoding on parse_string to UTF-8 * lints * properly encode search term * lints * add changelog file * update changelog number * set changelog entry filetype to .bugfix * Revert "set changelog entry filetype to .bugfix" This reverts commit be8e5a314251438ec4ec7dbc59ba32162c93e550. * update changelog message and file type * change parse_string default encoding back to ascii and update room search admin api calll to parse string * refactor tests * Update tests/rest/admin/test_room.py Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com>
-
David Robertson authored
It's a simplification, but one that'll help make the user directory logic easier to follow with the other changes upcoming. It's not strictly required for those changes, but this will help simplify the resulting logic that listens for `m.room.member` events and generally make the logic easier to follow. This means the config option `search_all_users` ends up controlling the search query only, and not the data we store. The cost of doing so is an extra row in the `user_directory` and `user_directory_search` tables for each local user which - belongs to no public rooms - belongs to no private rooms of size ≥ 2 I think the cost of this will be marginal (since they'll already have entries in `users` and `profiles` anyway). As a small upside, a homeserver whose directory was built with this change can toggle `search_all_users` without having to rebuild their directory. Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-
Aaron Raimist authored
* Allow membership event to unban user Signed-off-by:
Aaron Raimist <aaron@raim.ist>
-
- Sep 16, 2021
-
-
Patrick Cloke authored
To avoid duplicating it between a few tests.
-
- Sep 14, 2021
-
-
reivilibre authored
Also enables Mypy for related tests.
-
- Sep 13, 2021
-
-
Patrick Cloke authored
Instead of proxying through the magic getter of the RootConfig object. This should be more performant (and is more explicit).
-
- Sep 10, 2021
-
-
reivilibre authored
-
Patrick Cloke authored
By copying the `room_type` field of the create event and migrating any non-empty `m.space.child` events to the new room that is created.
-
David Robertson authored
No functional changes here. This came out as I was working to tackle #5677
-
- Sep 09, 2021
-
-
Sean authored
Signed-off-by:
Sean Quah <seanq@element.io>
-
- Sep 08, 2021
-
-
Richard van der Hoff authored
This is only called in two places, and the code seems much clearer without it.
-
Erik Johnston authored
Outlier events don't ever have push actions associated with them, so we can skip some expensive queries during event persistence.
-
Patrick Cloke authored
This adds the format to the request arguments / URL to ensure that JSON data is returned (which is all that Synapse supports). This also adds additional error checking / filtering to the configuration file to ignore XML-only providers.
-
- Sep 06, 2021
-
-
Azrenbeth authored
-
David Robertson authored
-
- Sep 03, 2021
-
-
Patrick Cloke authored
-
- Sep 01, 2021
-
-
Patrick Cloke authored
This avoids breaking the entire endpoint if a room with an unsupported room version is encountered.
-
Patrick Cloke authored
This updates the ordering of the returned events from the spaces summary API to that defined in MSC2946 (which updates MSC1772). Previously a step was skipped causing ordering to be inconsistent with clients.
-
Eric Eastwood authored
Part of https://github.com/matrix-org/synapse/pull/10566 - Fill in creator whenever we insert into the rooms table - Add background update to backfill any missing creator values
-
David Robertson authored
Judging by the template, this was intended ages ago, but we never actually passed an avatar URL to the template. So let's provide one. Closes #1546. Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com>
-
Andrew Morgan authored
-
- Aug 31, 2021
-
-
Patrick Cloke authored
This adds configuration options (under an `oembed` section) to configure which URLs are matched to use oEmbed for URL previews.
-
Richard van der Hoff authored
These were broken in an incorrect merge of GHSA-jj53-8fmw-f2w2 (cb35df94)
-
reivilibre authored
-