1
0
Commit Graph

21474 Commits

Author SHA1 Message Date
Eric Eastwood d92fd2aeac Revert other local change that we can't do 2022-09-30 13:58:17 -05:00
Eric Eastwood 7bd38034f9 Add test descriptions 2022-09-30 13:55:02 -05:00
Eric Eastwood 1218f03a8f Revert mock 2022-09-30 13:52:36 -05:00
Eric Eastwood 4451998d38 Clarify interested/control and lints 2022-09-30 13:51:06 -05:00
Eric Eastwood 76435c7915 Add actual homeserver tests for local/remote interesting to appservice users
See https://github.com/matrix-org/synapse/pull/13958#discussion_r984470972
2022-09-30 13:46:25 -05:00
Eric Eastwood 5d3c6a31dd Wrapping happens at 88 chars
See https://github.com/matrix-org/synapse/pull/13958#discussion_r984106210
2022-09-30 12:08:48 -05:00
Eric Eastwood 92b9da2f17 Fix tests 2022-09-29 19:22:47 -05:00
Eric Eastwood 72985dffdb Rename variables to 'local' to be obvious our intention 2022-09-29 18:59:41 -05:00
Eric Eastwood a8be41bb80 Revert back to using our own _matches_user_in_member_list thing
See https://github.com/matrix-org/synapse/pull/13958#discussion_r984074247
2022-09-29 18:57:07 -05:00
Eric Eastwood 5f0f81591b Add changelog 2022-09-29 18:52:23 -05:00
Eric Eastwood 806b25512e Remove non-appservice usages split out to other PRs 2022-09-29 18:49:19 -05:00
Eric Eastwood 99a623d209 Check appservice user interest against the local users instead of all users
`get_local_users_in_room` is way more performant since it looks at a single
table (`local_current_membership`) and is looking through way less
data since it only worries about the local users in the room instead
of everyone in the room across the federation.

Fix https://github.com/matrix-org/synapse/issues/13942

Related to:

 - https://github.com/matrix-org/synapse/pull/13605
 - https://github.com/matrix-org/synapse/pull/13608
 - https://github.com/matrix-org/synapse/pull/13606
2022-09-29 17:24:26 -05:00
David Robertson 6f0c3e669d Don't require setuptools_rust at runtime (#13952) 2022-09-29 20:16:08 +00:00
David Robertson 15754d720f Update UPSERT comment now that native upserts are the default (#13924) 2022-09-29 19:10:47 +01:00
Erik Johnston ebd9e2dac6 Implement push rule evaluation in Rust. (#13838) 2022-09-29 16:12:09 +01:00
Nick Mills-Barrett a466164647 Optimise get_rooms_for_user (drop with_stream_ordering) (#13787) 2022-09-29 13:55:12 +00:00
Brendan Abolivier be76cd8200 Allow admins to require a manual approval process before new accounts can be used (using MSC3866) (#13556) 2022-09-29 15:23:24 +02:00
Patrick Cloke 8625ad8099 Explicit cast to enforce type hints. (#13939) 2022-09-29 07:22:41 -04:00
Hugh Nimmo-Smith e5fdf16d46 Expose MSC3882 only be under an unstable endpoint. (#13868) 2022-09-29 07:22:27 -04:00
Patrick Cloke 568016929f Clarify that a method returns only unthreaded receipts. (#13937)
By renaming it and updating the docstring.

Additionally, refactors a method which is used only by tests.
2022-09-29 07:07:31 -04:00
Nicolas Werner 99a7e7e023 Always send default and rule_id to clients (#13904) 2022-09-29 11:57:00 +01:00
reivilibre 73ecff7e9e Improve backfill robustness by trying more servers. (#13890)
Co-authored-by: Eric Eastwood <erice@element.io>
2022-09-29 10:00:02 +00:00
Erik Johnston 5f659d4a88 Handle local device list updates during partial join (#13934) 2022-09-28 23:22:35 +01:00
Eric Eastwood df8b91ed2b Limit and filter the number of backfill points to get from the database (#13879)
There is no need to grab thousands of backfill points when we only need 5 to make the `/backfill` request with. We need to grab a few extra in case the first few aren't visible in the history.

Previously, we grabbed thousands of backfill points from the database, then sorted and filtered them in the app. Fetching the 4.6k backfill points for `#matrix:matrix.org` from the database takes ~50ms - ~570ms so it's not like this saves a lot of time 🤷. But it might save us more time now that `get_backfill_points_in_room`/`get_insertion_event_backward_extremities_in_room` are more complicated after https://github.com/matrix-org/synapse/pull/13635 

This PR moves the filtering and limiting to the SQL query so we just have less data to work with in the first place.

Part of https://github.com/matrix-org/synapse/issues/13356
2022-09-28 15:26:16 -05:00
Patrick Cloke d768c50c0e Add upgrade notes for changes to receipts replication. (#13932) 2022-09-28 11:33:31 -04:00
Patrick Cloke 1386ce4735 Revert "Stop returning an unused column when handling new receipts. (#13933)" (#13935)
This reverts commit 7766bd5b35 (#13933).

The unused column is actually used, but much further down in the function.
2022-09-28 11:01:41 -04:00
Patrick Cloke 7766bd5b35 Stop returning an unused column when handling new receipts. (#13933) 2022-09-28 10:58:25 -04:00
Andrew Morgan 25c0e69392 Document that the 'auto_join_rooms' option works with Spaces (#13931) 2022-09-28 14:13:19 +00:00
Andrew Morgan 220b21936e Correct default number of bcrypt hash rounds in .1 man page (#13930) 2022-09-28 14:45:13 +01:00
Erik Johnston 4b17a5ace8 Handle remote device list updates during partial join (#13913)
c.f. #12993 (comment), point 3

This stores all device list updates that we receive while partial joins are ongoing, and processes them once we have the full state.

Note: We don't actually process the device lists in the same ways as if we weren't partially joined. Instead of updating the device list remote cache, we simply notify local users that a change in the remote user's devices has happened. I think this is safe as if the local user requests the keys for the remote user and we don't have them we'll simply fetch them as normal.
2022-09-28 13:42:43 +00:00
Kateřina Churanová 6caa303083 fix: Push notifications for invite over federation (#13719) 2022-09-28 12:31:53 +00:00
Ashish Kumar 5c429b86b4 Add instruction for running unit tests in parallel (#13928) 2022-09-28 11:14:35 +00:00
Shay 8ab16a92ed Persist CreateRoom events to DB in a batch (#13800) 2022-09-28 10:11:48 +00:00
Shay a2cf66a94d Prepatory work for batching events to send (#13487)
This PR begins work on batching up events during the creation of a room. The PR splits out the creation and sending/persisting of the events. The first three events in the creation of the room-creating the room, joining the creator to the room, and the power levels event are sent sequentially, while the subsequent events are created and collected to be sent at the end of the function. This is currently done by appending them to a list and then iterating over the list to send, the next step (after this PR) would be to send and persist the collected events as a batch.
2022-09-28 10:39:03 +01:00
Eric Eastwood 29269d9d3f Fix have_seen_event cache not being invalidated (#13863)
Fix https://github.com/matrix-org/synapse/issues/13856
Fix https://github.com/matrix-org/synapse/issues/13865

> Discovered while trying to make Synapse fast enough for [this MSC2716 test for importing many batches](https://github.com/matrix-org/complement/pull/214#discussion_r741678240). As an example, disabling the `have_seen_event` cache saves 10 seconds for each `/messages` request in that MSC2716 Complement test because we're not making as many federation requests for `/state` (speeding up `have_seen_event` itself is related to https://github.com/matrix-org/synapse/issues/13625) 
> 
> But this will also make `/messages` faster in general so we can include it in the [faster `/messages` milestone](https://github.com/matrix-org/synapse/milestone/11).
> 
> *-- https://github.com/matrix-org/synapse/issues/13856*


### The problem

`_invalidate_caches_for_event` doesn't run in monolith mode which means we never even tried to clear the `have_seen_event` and other caches. And even in worker mode, it only runs on the workers, not the master (AFAICT).

Additionally there was bug with the key being wrong so `_invalidate_caches_for_event` never invalidates the `have_seen_event` cache even when it does run.

Because we were using the `@cachedList` wrong, it was putting items in the cache under keys like `((room_id, event_id),)` with a `set` in a `set` (ex. `(('!TnCIJPKzdQdUlIyXdQ:test', '$Iu0eqEBN7qcyF1S9B3oNB3I91v2o5YOgRNPwi_78s-k'),)`) and we we're trying to invalidate with just `(room_id, event_id)` which did nothing.
2022-09-27 15:55:43 -05:00
Eric Eastwood 35e9d6a616 Emphasize the right reasons to use (room_id, event_id) in a schema (#13915)
* Emphasize the right reasons to use (room_id, event_id)

Follow-up to:
 - https://github.com/matrix-org/synapse/pull/13701
 - https://github.com/matrix-org/synapse/pull/13771
2022-09-27 19:43:16 +00:00
David Robertson f5aaa55e27 Add new columns tracking when we partial-joined (#13892) 2022-09-27 17:26:35 +01:00
Patrick Cloke 87fe9db467 Support the stable dir parameter for /relations. (#13920)
Since MSC3715 has passed FCP, the stable parameter can be used.

This currently falls back to the unstable parameter if the stable
parameter is not provided (and MSC3715 support is enabled in
the configuration).
2022-09-27 10:47:34 -04:00
Erik Johnston 299b00d968 Prioritize outbound to-device over device list updates (#13922)
Otherwise device list changes for large accounts can temporarily delay to-device messages.
2022-09-27 15:17:41 +01:00
David Robertson ac1b0d03a5 Merge branch 'master' into develop 2022-09-27 15:05:16 +01:00
David Robertson 9bd442e202 Update upgrade notes (#13923)
* Update upgrade notes

* Synapse Synapse Synapse Synapse

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>

Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
2022-09-27 15:04:24 +01:00
Mathieu Velten 42dd992bb7 Dockerfile for tests: align comments with current behavior (#13867)
Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2022-09-27 15:55:43 +02:00
Quentin Gliech 50c92f3a69 Carry IdP Session IDs through user-mapping sessions. (#13839)
Since #11482, we're saving sessions IDs from upstream IdPs, but we've been losing them when the user goes through a user mapping session on account registration.
2022-09-27 14:38:14 +01:00
David Robertson a95ce6dd08 Merge branch 'master' into develop 2022-09-27 14:32:23 +01:00
Erik Johnston e8318a4333 Handle the case of remote users leaving a partial join room for device lists (#13885) 2022-09-27 13:01:08 +01:00
David Robertson 3853011d01 Clarify who isn't affected by rust v1.68.0 2022-09-27 12:34:31 +01:00
David Robertson 0bebc908ec s/Synapse v1/Synapse 1/g 2022-09-27 12:21:56 +01:00
David Robertson 3fe2b7f122 tweak upgrade notes 2022-09-27 12:18:40 +01:00
David Robertson 773277482a typo fixes 2022-09-27 12:09:27 +01:00
David Robertson 7bd9e1dc48 SQLite earlier than -> SQLite older than 2022-09-27 12:06:15 +01:00