- Oct 26, 2021
-
-
Jason Robinson authored
Users admin API can now also modify user type in addition to allowing it to be set on user creation. Signed-off-by:
Jason Robinson <jasonr@matrix.org> Co-authored-by:
Brendan Abolivier <babolivier@matrix.org>
-
- Oct 25, 2021
-
-
AndrewFerr authored
Fixes: #10929 Signed-off-by:
Andrew Ferrazzutti <fair@miscworks.net>
-
- Oct 22, 2021
-
-
Jason Robinson authored
`synapse.config.__main__` has the possibility to read a config item. This can be used to conveniently also validate the config is valid before trying to start Synapse. The "read" command broke in https://github.com/matrix-org/synapse/pull/10916 as it now requires passing in "server.server_name" for example. Also made the read command optional so one can just call this with just the confirm file reference and get a "Config parses OK" if things are ok. Signed-off-by:
Jason Robinson <jasonr@matrix.org> Co-authored-by:
Brendan Abolivier <babolivier@matrix.org>
-
- Oct 21, 2021
-
-
Patrick Cloke authored
Adds experimental support for MSC3440's `io.element.thread` relation type (and the aggregation for it).
-
David Robertson authored
* We only need to fetch users in private rooms * Filter out `user_id` at the top * Discard excluded users in the top loop We weren't doing this in the "First, if they're our user" branch so this is a bugfix. * The caller must check that `user_id` is included This is in the docstring. There are two call sites: - one in `_handle_room_publicity_change`, which explicitly checks before calling; - and another in `_handle_room_membership_event`, which returns early if the user is excluded. So this change is safe. * Test joining a private room with an excluded user * Tweak an existing test * Changelog * test docstring * lint
-
Dirk Klimpel authored
Fix setting a user's external_id via the admin API returns 500 and deletes users existing external mappings if that external ID is already mapped (#11051) Fixes #10846
-
- Oct 20, 2021
-
-
Aaron R authored
-
- Oct 18, 2021
-
-
Richard van der Hoff authored
This fixes a bug where we would accept an event whose `auth_events` include rejected events, if the rejected event was shadowed by another `auth_event` with same `(type, state_key)`. The approach is to pass a list of auth events into `check_auth_rules_for_event` instead of a dict, which of course means updating the call sites. This is an extension of #10956.
-
David Robertson authored
-
- Oct 15, 2021
-
-
David Robertson authored
Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com>
-
- Oct 14, 2021
-
-
Eric Eastwood authored
Found while working on the Gitter backfill script and noticed it only happened after we sent 7 batches, https://gitlab.com/gitterHQ/webapp/-/merge_requests/2229#note_665906390 When there are more than 5 backward extremities for a given depth, backfill will throw an error because we sliced the extremity list to 5 but then try to iterate over the full list. This causes us to look for state that we never fetched and we get a `KeyError`. Before when calling `/messages` when there are more than 5 backward extremities: ``` Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 258, in _async_render_wrapper callback_return = await self._async_render(request) File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 446, in _async_render callback_return = await raw_callback_return File "/usr/local/lib/python3.8/site-packages/synapse/rest/client/room.py", line 580, in on_GET msgs = await self.pagination_handler.get_messages( File "/usr/local/lib/python3.8/site-packages/synapse/handlers/pagination.py", line 396, in get_messages await self.hs.get_federation_handler().maybe_backfill( File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 133, in maybe_backfill return await self._maybe_backfill_inner(room_id, current_depth, limit) File "/usr/local/lib/python3.8/site-packages/synapse/handlers/federation.py", line 386, in _maybe_backfill_inner likely_extremeties_domains = get_domains_from_state(states[e_id]) KeyError: '$zpFflMEBtZdgcMQWTakaVItTLMjLFdKcRWUPHbbSZJl' ```
-
Patrick Cloke authored
There's no point in trying more than once since it is guaranteed to continually fail.
-
Patrick Cloke authored
This follows similar logic to BeautifulSoup where we attempt different character encodings until we find one which works.
-
Patrick Cloke authored
-
reivilibre authored
Add a test for a workaround concerning the behaviour of third-party rule modules and `SynapseError`s. (#11071)
-
- Oct 13, 2021
-
-
Azrenbeth authored
Co-authored-by:
Azrenbeth <7782548+Azrenbeth@users.noreply.github.com> Co-authored-by:
Brendan Abolivier <babolivier@matrix.org>
-
Patrick Cloke authored
-
David Robertson authored
The following scenarios would halt the user directory updater: - user joins room - user leaves room - user present in room which switches from private to public, or vice versa. for two classes of users: - appservice senders - users missing from the user table. If this happened, the user directory would be stuck, unable to make forward progress. Exclude both cases from the user directory, so that we ignore them. Co-authored-by:
Eric Eastwood <erice@element.io> Co-authored-by:
reivilibre <oliverw@matrix.org> Co-authored-by:
Sean Quah <8349537+squahtx@users.noreply.github.com> Co-authored-by:
Brendan Abolivier <babolivier@matrix.org>
-
- Oct 12, 2021
-
-
Dirk Klimpel authored
-
Sean Quah authored
-
Patrick Cloke authored
This reverts #11019 and structures the code a bit more like it was before #10985. The global cache state must be reset before running the tests since other test cases might have configured caching (and thus touched the global state).
-
Sean Quah authored
Make `get_last_client_by_ip` return the same dictionary structure regardless of whether the data has been persisted to the database. This change will allow slightly cleaner type hints to be applied later on.
-
reivilibre authored
-
- Oct 08, 2021
-
-
Patrick Cloke authored
Searches the returned HTML for an oEmbed endpoint using the autodiscovery mechanism (`<link rel=...>`), and will request it to generate the preview.
-
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.
-
Nick Barrett authored
-
- Oct 07, 2021
-
-
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>
-
- Oct 06, 2021
-
-
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>
-
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>
-
- 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>
-
- 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>
-
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
-
Patrick Cloke authored
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.
-