- Nov 03, 2021
-
-
Nick Barrett authored
Co-authored-by:
Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
-
- Oct 28, 2021
-
-
Rafael Gonçalves authored
Signed-off-by:
Rafael Goncalves <rafaelgoncalves@riseup.net>
-
- Oct 27, 2021
-
-
Dirk Klimpel authored
Fixes: #9346
-
- Oct 25, 2021
-
-
AndrewFerr authored
Fixes: #10929 Signed-off-by:
Andrew Ferrazzutti <fair@miscworks.net>
-
- Oct 21, 2021
-
-
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
-
- Oct 18, 2021
-
-
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' ```
-
- Oct 13, 2021
-
-
Azrenbeth authored
Co-authored-by:
Azrenbeth <7782548+Azrenbeth@users.noreply.github.com> Co-authored-by:
Brendan Abolivier <babolivier@matrix.org>
-
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 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.
-
- Oct 07, 2021
-
-
David Robertson authored
Co-authored-by:
Patrick Cloke <clokep@users.noreply.github.com>
-
- Oct 06, 2021
-
-
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 04, 2021
-
-
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
-
- Sep 30, 2021
-
-
Patrick Cloke authored
Uses `override_config` and fixes test_auto_create_auto_join_where_no_consent to properly configure auto-join rooms.
-
David Robertson authored
* Pull out GetUserDirectoryTables helper * Don't rebuild the dir in tests that don't need it In #10796 I changed registering a user to add directory entries under. This means we don't have to force a directory regbuild in to tests of the user directory search. * Move test_initial to tests/storage * Add type hints to both test_user_directory files Co-authored-by:
Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
-
- Sep 29, 2021
-
-
Patrick Cloke authored
-
- 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
-
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
-
-
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>
-
- Sep 21, 2021
-
-
Patrick Cloke authored
-
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>
-
- Sep 10, 2021
-
-
David Robertson authored
No functional changes here. This came out as I was working to tackle #5677
-
- Sep 06, 2021
-
-
David Robertson 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.
-
- Aug 27, 2021
-
-
Richard van der Hoff authored
Turns out that the functionality added in #10546 to skip TLS was incompatible with older Twisted versions, so we need to be a bit more inventive. Also, add a test to (hopefully) not break this in future. Sadly, testing TLS is really hard.
-
- Aug 26, 2021
-
-
Richard van der Hoff authored
The idea here is to take anything to do with incoming events and move it out to a separate handler, as a way of making FederationHandler smaller.
-
- Aug 19, 2021
-
-
Patrick Cloke authored
A user will still see this room if it is in a local cache, but it will not reappear if clearing the cache and reloading.
-
- Aug 17, 2021
-
-
reivilibre authored
-
- Aug 16, 2021
-
-
Michael Telatynski authored
-
Patrick Cloke authored
-
Šimon Brandner authored
* Handle string read receipt data Signed-off-by:
Šimon Brandner <simon.bra.ag@gmail.com> * Test that we handle string read receipt data Signed-off-by:
Šimon Brandner <simon.bra.ag@gmail.com> * Add changelog for #10606 Signed-off-by:
Šimon Brandner <simon.bra.ag@gmail.com> * Add docs Signed-off-by:
Šimon Brandner <simon.bra.ag@gmail.com> * Ignore malformed RRs Signed-off-by:
Šimon Brandner <simon.bra.ag@gmail.com> * Only surround hidden = ... Signed-off-by:
Šimon Brandner <simon.bra.ag@gmail.com> * Remove unnecessary argument Signed-off-by:
Šimon Brandner <simon.bra.ag@gmail.com> * Update changelog.d/10606.bugfix Co-authored-by:
Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
-
- Aug 11, 2021
-
-
Patrick Cloke authored
-
Patrick Cloke authored
As opposed to only allowing the summary of spaces which the user is already in or has world-readable visibility. This makes the logic consistent with whether a space/room is returned as part of a space and whether a space summary can start at a space.
-
Patrick Cloke authored
And ensure that the file is checked via mypy.
-
- Aug 10, 2021
-
-
Patrick Cloke authored
This adds support for the /hierarchy endpoint, which is an update to MSC2946. Currently this only supports rooms known locally to the homeserver.
-