- Oct 08, 2021
-
-
David Robertson authored
This splits apart `handle_new_user` into a function which adds an entry to the `user_directory` and a function which updates the room sharing tables. I plan to continue doing more of this kind of refactoring to clarify the implementation.
-
Patrick Cloke authored
The shared ratelimit function was replaced with a dedicated RequestRatelimiter class (accessible from the HomeServer object). Other properties were copied to each sub-class that inherited from BaseHandler.
-
Sean Quah authored
Use `PreserveLoggingContext()` to ensure that logging contexts are not lost when exiting a read/write lock. When exiting a read/write lock, callbacks on a `Deferred` are triggered as a signal to any waiting coroutines. Any waiting coroutine that becomes runnable is likely to follow the Synapse logging context rules and will restore its own logging context, then either run to completion or await another `Deferred`, resetting the logging context in the process.
-
Nick Barrett authored
-
Erik Johnston authored
This also turns off calculating code coverage, as we didn't use it and it was a lot of noise
-
- Oct 07, 2021
-
-
David Robertson authored
-
Patrick Cloke authored
Hopefully this fixes these tests sometimes failing in CI.
-
David Robertson authored
Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com>
-
Richard van der Hoff authored
Include the event ids being peristed
-
Richard van der Hoff authored
-
Brendan Abolivier authored
Looks like the wrong exception type was caught in #10932.
-
- Oct 06, 2021
-
-
David Robertson authored
* `disallow-untyped-defs` for `synapse.state` Much smaller than I was expecting!
-
Andrew Morgan authored
Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-
Brendan Abolivier authored
This is in the context of creating new module callbacks that modules in https://github.com/matrix-org/synapse-dinsic can use, in an effort to reconcile the spam checker API in synapse-dinsic with the one in mainline. Note that a module callback already exists for 3pid invites (https://matrix-org.github.io/synapse/develop/modules/third_party_rules_callbacks.html#check_threepid_can_be_invited) but it doesn't check whether the sender of the invite is allowed to send it.
-
Patrick Cloke authored
This removes the magic allowing accessing configurable variables directly from the config object. It is now required that a specific configuration class is used (e.g. `config.foo` must be replaced with `config.server.foo`).
-
Brendan Abolivier authored
Co-authored-by:
Erik Johnston <erik@matrix.org>
-
Brendan Abolivier authored
Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com>
-
David Robertson authored
Fix a long-standing bug where a batch of user directory changes would be silently dropped if the server left a room early in the batch. * Pull out `wait_for_background_update` in tests Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-
Max Kratz authored
-
Nick Barrett authored
Signed-off-by:
Nick Barrett <nick@beeper.com>
-
David Robertson authored
The following modules now pass `disallow_untyped_defs`: * synapse.util.caches.cached_call * synapse.util.caches.lrucache * synapse.util.caches.response_cache * synapse.util.caches.stream_change_cache * synapse.util.caches.ttlcache pass * synapse.util.daemonize * synapse.util.patch_inline_callbacks pass `no-untyped-defs` * synapse.util.versionstring Additional typing in synapse.util.metrics. Didn't get this to pass `no-untyped-defs`, think I'll need to watch #10847
-
Max Kratz authored
-
- Oct 05, 2021
-
-
David Robertson authored
There are two steps to rebuilding the user directory: 1. a scan over rooms, followed by 2. a scan over local users. The former reads avatars and display names from the `room_memberships` table and therefore contains potentially private avatars and display names. The latter reads from the the `profiles` table which only contains public data; moreover it will overwrite any private profiles that the rooms scan may have written to the user directory. This means that the rebuild could leak private user while the rebuild was in progress, only to later cover up the leaks once the rebuild had completed. This change skips over local users when writing user_directory rows when scanning rooms. Doing so means that it'll take longer for a rebuild to make local users searchable, which is unfortunate. I think a future PR can improve this by swapping the order of the two steps above. (And indeed there's more to do here, e.g. copying from `profiles` without going via Python.) Small tidy-ups while I'm here: * Remove duplicated code from test_initial. This was meant to be pulled into `purge_and_rebuild_user_dir`. * Move `is_public` before updating sharing tables. No functional change; it's still before the first read of `is_public`. * Don't bother creating a set from dict keys. Slightly nicer and makes the code simpler. Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-
Eric Eastwood authored
We correctly allowed using the MSC2716 batch endpoint for the room creator in existing room versions but accidentally didn't track the events because of a logic flaw. This prevented you from connecting subsequent chunks together because it would throw the unknown batch ID error. We only want to process MSC2716 events when: - The room version supports MSC2716 - Any room where the homeserver has the `msc2716_enabled` experimental feature enabled and the event is from the room creator
-
Brendan Abolivier authored
-
Richard van der Hoff authored
When we consider whether to accept events, we should not accept those which depend on rejected events for their auth events. This (together with earlier changes such as https://github.com/matrix-org/synapse/pull/10771 and https://github.com/matrix-org/synapse/pull/10896) forms a partial fix to https://github.com/matrix-org/synapse/issues/9595. There still remain code paths where we do not check the `auth_events` at all.
-
Richard van der Hoff authored
`_check_event_auth` is only called in two places, and only one of those sets `send_on_behalf_of`. Warming the cache isn't really part of auth anyway, so moving it out makes a lot more sense.
-
Richard van der Hoff authored
Add some more comments about wtf is going on here.
-
Richard van der Hoff authored
There's little point in doing a fancy state reconciliation dance if the event itself is invalid. Likewise, there's no point checking it again in `_check_for_soft_fail`.
-
David Robertson authored
-
Dirk Klimpel authored
Based on matrix-doc switching from master -> main and MSCs being merged.
-
Sean Quah authored
Make it easier to track down where opentracing spans are going missing by including stack traces in the logs.
-
- Oct 04, 2021
-
-
Hillery Shay authored
* add test * add function to remove user from monthly active table in deactivate code * add function to remove user from monthly active table * add changelog entry * update changelog number * requested changes * update docstring on new function * fix lint error * Update synapse/storage/databases/main/monthly_active_users.py Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-
AndrewFerr authored
Signed-off-by:
Andrew Ferrazzutti <fair@miscworks.net>
-
Brendan Abolivier authored
Synapse 1.44.0rc3 (2021-10-04) ============================== Bugfixes -------- - Fix a bug introduced in Synapse v1.40.0 where changing a user's display name or avatar in a restricted room would cause an authentication error. ([\#10933](https://github.com/matrix-org/synapse/issues/10933)) - Fix `/admin/whois/{user_id}` endpoint, which was broken in v1.44.0rc1. ([\#10968](https://github.com/matrix-org/synapse/issues/10968))
-
David Robertson authored
* Introduce `should_include_local_users_in_dir` We exclude three kinds of local users from the user_directory tables. At present we don't consistently exclude all three in the same places. This commit introduces a new function to gather those exclusion conditions together. Because we have to handle local and remote users in different ways, I've made that function only consider the case of remote users. It's the caller's responsibility to make the local versus remote distinction clear and correct. A test fixup is required. The test now hits a path which makes db queries against the users table. The expected rows were missing, because we were using a dummy user that hadn't actually been registered. We also add new test cases to covert the exclusion logic. ---- By my reading this makes these changes: * When an app service user registers or changes their profile, they will _not_ be added to the user directory. (Previously only support and deactivated users were excluded). This is consistent with the logic that rebuilds the user directory. See also [the discussion here](https://github.com/matrix-org/synapse/pull/10914#discussion_r716859548 ). * When rebuilding the directory, exclude support and disabled users from room sharing tables. Previously only appservice users were excluded. * Exclude all three categories of local users when rebuilding the directory. Previously `_populate_user_directory_process_users` didn't do any exclusion. Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-
Patrick Cloke authored
-
- Oct 01, 2021
-
-
Sean Quah authored
-