Compare commits

...

786 Commits

Author SHA1 Message Date
Olivier Wilkinson (reivilibre)
6ca19565b4 TEMPORARY Resources for gacducit 2023-10-20 18:01:52 +01:00
Olivier Wilkinson (reivilibre)
e19dfa15a4 CHECKPOINT 2023-10-20 16:17:39 +01:00
Patrick Cloke
07b3b9a95e Merge branch 'release-v1.95' into matrix-org-hotfixes 2023-10-17 11:56:14 -04:00
Olivier Wilkinson (reivilibre)
e09b91b9d6 Revert "TEMPORARY Measure and log test cases"
This reverts commit adfdd6afe1.
2023-10-17 11:44:57 +01:00
Olivier Wilkinson (reivilibre)
adfdd6afe1 TEMPORARY Measure and log test cases 2023-10-17 11:42:24 +01:00
Olivier Wilkinson (reivilibre)
8c60ebf209 Revert "TEMPORARY Subdivide _resolve_events Measure blocks"
This reverts commit f3db863420.
2023-10-16 18:24:46 +01:00
Olivier Wilkinson (reivilibre)
1e1cf4bb9d Revert "TEMPORARY Add more Measure blocks"
This reverts commit adfa0fded3.
2023-10-16 18:24:45 +01:00
Olivier Wilkinson (reivilibre)
adfa0fded3 TEMPORARY Add more Measure blocks 2023-10-16 18:15:48 +01:00
Olivier Wilkinson (reivilibre)
f3db863420 TEMPORARY Subdivide _resolve_events Measure blocks 2023-10-16 17:55:05 +01:00
Olivier Wilkinson (reivilibre)
96769a229c TEMPORARY Disable prune_old_outbound_device_pokes
See #16480
2023-10-16 17:37:58 +01:00
David Robertson
6cb0b8b048 Merge remote-tracking branch 'origin/release-v1.94' into matrix-org-hotfixes 2023-10-03 12:03:50 +01:00
Patrick Cloke
656ffa23c9 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-10-02 09:08:23 -04:00
Patrick Cloke
e60993e42d Revert "Temporarily disable webp thumbnailing"
This reverts commit 93248076c2.
2023-09-25 08:12:05 -04:00
Patrick Cloke
7ab1b46029 Merge remote-tracking branch 'origin/release-v1.93' into matrix-org-hotfixes 2023-09-19 08:14:46 -04:00
Erik Johnston
93248076c2 Temporarily disable webp thumbnailing 2023-09-15 15:45:41 +01:00
Erik Johnston
1e0b96f1a4 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-09-14 16:21:58 +01:00
Erik Johnston
60b3dc65f6 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-09-13 11:59:54 +01:00
Erik Johnston
9a28f154c8 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-09-13 11:54:35 +01:00
Erik Johnston
3bb8cce692 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-09-13 11:12:26 +01:00
Patrick Cloke
ec703e7d97 Merge branch 'release-v1.92' into matrix-org-hotfixes 2023-09-06 11:25:41 -04:00
David Robertson
0e8cbbdb8e Merge remote-tracking branch 'origin/release-v1.92' into matrix-org-hotfixes 2023-09-05 14:40:53 +01:00
David Robertson
e4fe4dbecd Merge remote-tracking branch 'origin/release-v1.91' into matrix-org-hotfixes 2023-09-04 10:42:51 +01:00
Erik Johnston
535e5832a3 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-08-23 16:24:44 +01:00
Erik Johnston
a8bd3df5e1 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-08-23 14:00:49 +01:00
Erik Johnston
b7d0c7d3fd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-08-23 13:46:10 +01:00
Erik Johnston
144cf227ca Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-08-23 09:41:34 +01:00
Erik Johnston
de16789d87 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-08-18 11:06:02 +01:00
Erik Johnston
94d4507d35 Merge remote-tracking branch 'origin/release-v1.90' into matrix-org-hotfixes 2023-08-09 11:00:30 +01:00
Mathieu Velten
42ec11ae56 Merge branch 'release-v1.89' into matrix-org-hotfixes 2023-07-26 14:57:13 +02:00
Mathieu Velten
2eada7ef13 Merge branch 'release-v1.89' into matrix-org-hotfixes 2023-07-25 14:43:27 +02:00
Erik Johnston
b89e8d695d Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-07-20 16:19:45 +01:00
Erik Johnston
d9fa426a54 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-07-20 11:08:14 +01:00
Erik Johnston
1ea1a0b251 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-07-20 10:50:03 +01:00
Olivier Wilkinson (reivilibre)
d31e6c7541 Merge branch 'release-v1.88' into matrix-org-hotfixes 2023-07-18 14:11:42 +01:00
David Robertson
426cf50ecc Merge remote-tracking branch 'origin/release-v1.88' into matrix-org-hotfixes 2023-07-11 10:37:37 +01:00
Erik Johnston
21cb804023 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-06-27 10:31:31 +01:00
Erik Johnston
fb8d629dcd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-06-23 09:31:50 +01:00
Mathieu Velten
98a00339a5 Merge branch 'release-v1.86' into matrix-org-hotfixes 2023-06-13 11:27:29 +02:00
David Robertson
50cb0d298a Merge remote-tracking branch 'origin/release-v1.85' into matrix-org-hotfixes 2023-06-01 11:12:11 +01:00
David Robertson
4427151a21 Merge remote-tracking branch 'origin/release-v1.85' into matrix-org-hotfixes 2023-05-30 14:20:41 +01:00
Erik Johnston
881855d4e3 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-05-24 15:49:43 +01:00
Olivier Wilkinson (reivilibre)
184a688c64 Merge branch 'release-v1.84' into matrix-org-hotfixes 2023-05-16 12:14:55 +01:00
Erik Johnston
106fb7005d Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-05-12 11:38:28 +01:00
Erik Johnston
7c74fe01d3 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-05-12 11:09:10 +01:00
Sean Quah
36b72b9f2e Revert "Redirect event persistence traffic to a particular event persister worker"
Now that things have settled down in the two rooms we special-cased, we
can return the sharding config to normal.

Rich suspects that event_persister-4 being idle was the cause of
federation senders getting stuck on 2023-05-11. It was observed that the
min stream position of RoomStreamTokens was not advancing.

This reverts commit 2263c3bcd7.
2023-05-12 11:01:57 +01:00
Andrew Morgan
2263c3bcd7 Redirect event persistence traffic to a particular event persister worker 2023-05-10 19:55:20 +01:00
Sean Quah
c9b98e85b6 Merge remote-tracking branch 'origin/release-v1.83' into matrix-org-hotfixes 2023-05-03 13:11:09 +01:00
Sean Quah
c2abd04877 Merge remote-tracking branch 'origin/release-v1.83' into matrix-org-hotfixes 2023-05-02 16:33:00 +01:00
David Robertson
d1b33ae118 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-04-26 11:38:39 +01:00
Olivier Wilkinson (reivilibre)
d94aba25a6 Merge branch 'release-v1.82' into matrix-org-hotfixes 2023-04-18 10:59:20 +01:00
Olivier Wilkinson (reivilibre)
85fc42c546 Merge branch 'release-v1.82' into matrix-org-hotfixes 2023-04-18 10:24:22 +01:00
Olivier Wilkinson (reivilibre)
2cf9f78d23 Merge branch 'develop' into matrix-org-hotfixes 2023-04-13 15:06:42 +01:00
Olivier Wilkinson (reivilibre)
7212fc4659 Merge branch 'develop' into matrix-org-hotfixes 2023-04-13 11:55:21 +01:00
David Robertson
b1c36648b5 Merge remote-tracking branch 'origin/release-v1.81' into matrix-org-hotfixes 2023-04-06 15:33:43 +01:00
Erik Johnston
ab0a5f1972 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-04-04 14:11:53 +01:00
Erik Johnston
5c42359de8 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-03-31 13:52:25 +01:00
Sean Quah
46a2fbea6a Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-03-31 12:12:40 +01:00
Sean Quah
bf81ee4217 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-03-31 10:17:16 +01:00
Erik Johnston
16e07b6742 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-03-29 14:43:08 +01:00
Erik Johnston
85630ad1f8 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-03-29 13:24:47 +01:00
Erik Johnston
34a2dff973 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-03-29 13:10:57 +01:00
Mathieu Velten
53352a2b80 Merge remote-tracking branch 'origin/release-v1.80' into matrix-org-hotfixes 2023-03-22 11:28:59 +01:00
Mathieu Velten
6400f03029 Merge remote-tracking branch 'origin/release-v1.80' into matrix-org-hotfixes 2023-03-21 12:52:12 +01:00
David Robertson
7317f83510 Merge remote-tracking branch 'origin/release-v1.79' into matrix-org-hotfixes 2023-03-13 13:00:31 +00:00
David Robertson
b4df6be0d0 Revert "Hack to workaround libera federation pain"
This reverts commit ab629c17cc.
2023-03-13 12:44:50 +00:00
David Robertson
ab629c17cc Hack to workaround libera federation pain
as seen in https://github.com/matrix-org/synapse/issues/15216
2023-03-07 19:49:14 +00:00
David Robertson
a95e906227 Merge remote-tracking branch 'origin/release-v1.79' into matrix-org-hotfixes 2023-03-07 12:17:08 +00:00
Erik Johnston
b67e4b6015 Merge remote-tracking branch 'origin/release-v1.78' into matrix-org-hotfixes 2023-02-24 14:45:26 +00:00
Olivier Wilkinson (reivilibre)
6bb4db78ce MORG HOTFIXES: increase /state response body size limit to 600MB
See #15127.
2023-02-21 20:03:45 +00:00
Olivier Wilkinson (reivilibre)
e0f9a514c6 Merge branch 'release-v1.78' into matrix-org-hotfixes 2023-02-21 14:47:40 +00:00
David Robertson
e984b6f9dd Use changelog from release branch 2023-02-10 18:24:15 +00:00
David Robertson
4d2d701840 Clean up old changelog files 2023-02-10 18:22:26 +00:00
David Robertson
269f22478c Merge branch 'release-v1.77' into matrix-org-hotfixes 2023-02-10 18:05:34 +00:00
Erik Johnston
19bb342763 Merge remote-tracking branch 'origin/release-v1.77' into matrix-org-hotfixes 2023-02-09 15:30:19 +00:00
Patrick Cloke
3be2fc192d Merge remote-tracking branch 'origin/release-v1.77' into matrix-org-hotfixes 2023-02-08 10:24:46 -05:00
David Robertson
599960bacf Merge remote-tracking branch 'origin/release-v1.77' into matrix-org-hotfixes 2023-02-07 16:27:37 +00:00
David Robertson
78a4caad72 Merge branch 'release-v1.77' into matrix-org-hotfixes 2023-02-07 13:48:42 +00:00
Patrick Cloke
306ecd6740 Skip unused calculations in sync handler. (#14908)
If a sync request does not need to calculate per-room entries &
is not generating presence & is not generating device list data
(e.g. during initial sync) avoid the expensive calculation of room
specific data.

This is a micro-optimisation for clients syncing simply to receive
to-device information.
2023-02-02 18:49:38 +00:00
Patrick Cloke
0f63c73cf7 Do not calculate presence or ephemeral events when they are filtered out (#14970)
This expands the previous optimisation from being only for initial
sync to being for all sync requests.

It also inverts some of the logic to be inclusive instead of exclusive.
2023-02-02 18:49:32 +00:00
David Robertson
c9564e08ba Fix stupid bug 2023-02-02 16:47:39 +00:00
David Robertson
ea3210f8e5 Don't notify a target who's not in the room
Also avoid unncessary DB queries when creating a room
2023-02-02 16:30:30 +00:00
David Robertson
a7fa951876 Only notify the target of a membership event
Naughty, but should be a big speedup in large rooms

Changelog
2023-02-02 15:43:10 +00:00
David Robertson
769406378c Cherry-pick "Fetch fewer events when getting hosts in room" (WIP #14962)
This is a squashed verion of the following commits:

- bc739a444fb5bffc6dd3b57399a223bc5b5b4a15
- 70947443798e995ff026819cf5dd6823134ac81a
- f781304e1882fd60cdef84d3405767773237629d
- 7ee3976debf925fc2f79381c0c51003588e31e32
2023-02-01 18:41:56 +00:00
David Robertson
e03b1e858b Fix my hack
The tag isn't set unless we force tracing, apparently
2023-02-01 12:27:22 +00:00
David Robertson
d6e40d75ff HACK: force tracing for partial state /send_join responses 2023-01-31 15:28:55 +00:00
David Robertson
873cf51149 Tag /send_join responses to detect faster joins (#14950)
* Tag /send_join responses to detect faster joins

* Changelog

* Define a proper SynapseTag

* isort
2023-01-31 15:25:47 +00:00
David Robertson
488cea0399 Revert "Tag /send_join responses to detect faster joins"
This reverts commit 204bdb7f07. I will
cherry pick #14950 in its place.
2023-01-31 15:25:04 +00:00
David Robertson
204bdb7f07 Tag /send_join responses to detect faster joins 2023-01-31 11:25:21 +00:00
David Robertson
484db60cd6 Merge remote-tracking branch 'origin/release-v1.76' into matrix-org-hotfixes 2023-01-26 17:20:12 +00:00
David Robertson
505d85e0db Merge remote-tracking branch 'origin/dmr/bump-state-timeouts' into matrix-org-hotfixes 2023-01-25 15:29:55 +00:00
David Robertson
5d8486d43e Milliseconds!!!! 2023-01-25 15:27:18 +00:00
David Robertson
8d6bb6e8ee Merge remote-tracking branch 'origin/dmr/bump-state-timeouts' into matrix-org-hotfixes 2023-01-25 15:19:33 +00:00
David Robertson
42996efa78 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-01-25 15:19:17 +00:00
David Robertson
840ba65d92 Changelog 2023-01-25 15:18:17 +00:00
David Robertson
16a4473034 Bump the client-side timeout for /state
to allow faster joins resyncs the chance to complete for large rooms.
We have seen this fair poorly (~90s for Matrix HQ's /state) in testing,
causing the resync to advance to another HS who hasn't seen our join yet.
2023-01-25 15:14:26 +00:00
David Robertson
c4c8a2716e Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-01-23 11:46:48 +00:00
Erik Johnston
94a75ab6af Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-01-20 09:30:27 +00:00
Erik Johnston
1b001d1069 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2023-01-19 14:21:55 +00:00
David Robertson
6a185c8b17 Merge remote-tracking branch 'origin/release-v1.75' into matrix-org-hotfixes 2023-01-12 10:38:17 +00:00
David Robertson
04aa6a9707 Merge remote-tracking branch 'origin/release-v1.75' into matrix-org-hotfixes 2023-01-10 12:43:28 +00:00
Olivier Wilkinson (reivilibre)
5a1b56b9b0 Merge branch 'rei/dresync_exp' into matrix-org-hotfixes 2022-12-21 13:13:30 +00:00
Olivier Wilkinson (reivilibre)
62e4ad7991 Use the multi-user device resync to batch requests 2022-12-21 13:12:53 +00:00
Olivier Wilkinson (reivilibre)
24b802a524 Merge branch 'rei/dresync_exp' into matrix-org-hotfixes 2022-12-21 11:42:37 +00:00
Olivier Wilkinson (reivilibre)
55a4d7e1ce Typo fix 2022-12-21 11:42:31 +00:00
Olivier Wilkinson (reivilibre)
ad8265562d Merge branch 'rei/hiredis_210_no_sdist' into matrix-org-hotfixes 2022-12-21 11:12:50 +00:00
Olivier Wilkinson (reivilibre)
50a56edcc2 Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2022-12-21 11:04:34 +00:00
Olivier Wilkinson (reivilibre)
3ac08cc0be Revert "Bump hiredis from 2.0.0 to 2.1.0 (#14699)"
This reverts commit 9c89707b56.
2022-12-21 11:03:26 +00:00
Olivier Wilkinson (reivilibre)
83dab8e25f Merge branch 'rei/dresync_exp' into matrix-org-hotfixes 2022-12-21 10:51:29 +00:00
Olivier Wilkinson (reivilibre)
65981bcb27 Merge branch 'rei/jumptodate_statement_limit' into matrix-org-hotfixes 2022-12-21 10:51:27 +00:00
Olivier Wilkinson (reivilibre)
cbf1cebef3 Mitigate jump to date slowness by adding 30s timeout 2022-12-20 18:30:47 +00:00
Olivier Wilkinson (reivilibre)
46807789d0 Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
712144e768 Batch up the DB writes when marking failures 2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
3d7451e04f Split out the marking of failed 2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
3c68aa4342 Use the multi-user path even for single users
This is futureproofing: we'll be able to rip out the single-user path later
2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
369a97a714 Use assertions to ensure we don't have our expectations broken 2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
b4f98428ca Add a replication servlet for multi-user device resync 2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
55f46d499b Add multi-user device resync in handler 2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
7d2261f922 Limit query_devices_for_destination to 10 concurrent invocations 2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
227c953d99 Add async helpers 2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
9c4562c74a Add log lines 2022-12-20 18:21:31 +00:00
Olivier Wilkinson (reivilibre)
2654d61114 Build a set of who we are interested in first and foremost 2022-12-20 18:21:31 +00:00
Sean Quah
9d40fc961b Merge branch 'release-v1.74' into matrix-org-hotfixes 2022-12-13 13:45:55 +00:00
Olivier Wilkinson (reivilibre)
d0df5cc8ad Merge branch 'develop' into matrix-org-hotfixes 2022-12-12 14:46:11 +00:00
Erik Johnston
3cab3dae20 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-12-09 17:06:39 +00:00
Erik Johnston
6cbd5ed0c2 Revert "Revert "Delete stale non-e2e devices for users, take 2 (#14595)""
This reverts commit 694a3fd5c2.
2022-12-09 17:06:34 +00:00
Andrew Morgan
694a3fd5c2 Revert "Delete stale non-e2e devices for users, take 2 (#14595)"
This reverts commit c2de2ca630.
2022-12-09 16:36:15 +00:00
Erik Johnston
90d007ec57 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-12-09 09:53:29 +00:00
Olivier Wilkinson (reivilibre)
e966424466 Merge branch 'develop' into matrix-org-hotfixes 2022-12-07 12:25:52 +00:00
David Robertson
34fa1276a4 Merge branch 'release-v1.73' into matrix-org-hotfixes 2022-12-01 10:03:23 +00:00
David Robertson
9d943ba8a6 Merge remote-tracking branch 'origin/release-v1.73' into matrix-org-hotfixes 2022-11-29 13:05:38 +00:00
David Robertson
b968ecdf45 Merge remote-tracking branch 'origin/release-v1.73' into matrix-org-hotfixes 2022-11-29 12:34:53 +00:00
Erik Johnston
28a84af1bc Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-11-23 14:22:56 +00:00
Erik Johnston
47534a1bff Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-11-22 21:58:38 +00:00
Erik Johnston
2f59645025 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-11-22 16:50:52 +00:00
Erik Johnston
5436c3e0ad Ignore device list updates for users with large numbers of devices 2022-11-22 16:50:48 +00:00
David Robertson
c3336516d2 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-11-22 14:52:01 +00:00
Erik Johnston
6f577a0c21 Merge branch 'release-v1.72' into matrix-org-hotfixes 2022-11-16 15:11:58 +00:00
Richard van der Hoff
39ea774cff Merge branch 'rav/patch_events_bg_update' into matrix-org-hotfixes 2022-11-05 18:25:11 +00:00
Richard van der Hoff
779d48f4de Fix background update table-scanning events
When this background update did its last batch, it would try to update all the
events that had been inserted since the bgupdate started, which could cause a
table-scan. Make sure we limit the update correctly
2022-11-05 18:23:13 +00:00
Sean Quah
52d4c9f051 Merge remote-tracking branch 'origin/release-v1.71' into matrix-org-hotfixes 2022-11-04 12:20:05 +00:00
Sean Quah
4b38c0a5f2 Merge branch 'squah/unrevert-fts-changes-on-hotfix' into matrix-org-hotfixes 2022-11-04 11:39:49 +00:00
Sean Quah
02a25ce3f9 Revert "Revert "Switch search SQL to triple-quote strings. (#14311)""
This reverts commit 220af1df54.
2022-11-04 11:38:46 +00:00
Sean Quah
e2008e4ef5 Revert "Revert "Fix tests for change in PostgreSQL 14 behavior change. (#14310)""
This reverts commit 7f77f1386c.
2022-11-04 11:38:39 +00:00
Sean Quah
3b44a7c9d1 Revert "Revert "Unified search query syntax using the full-text search capabilities of the underlying DB. (#11635)""
This reverts commit 7e0dd52782.
2022-11-04 11:38:31 +00:00
Sean Quah
f8f01b869e Revert "Disable auto search for prefixes in event search"
This reverts commit 24409c7c15.
2022-11-04 11:38:23 +00:00
David Robertson
37307a5cce Merge branch 'dmr/revert-fts-changes-on-hotfix' into matrix-org-hotfixes 2022-11-02 12:35:00 +00:00
Erik Johnston
24409c7c15 Disable auto search for prefixes in event search 2022-11-02 12:31:16 +00:00
David Robertson
7e0dd52782 Revert "Unified search query syntax using the full-text search capabilities of the underlying DB. (#11635)"
This reverts commit d902181de9.
2022-11-02 12:29:34 +00:00
David Robertson
7f77f1386c Revert "Fix tests for change in PostgreSQL 14 behavior change. (#14310)"
This reverts commit 67583281e3.
2022-11-02 12:28:47 +00:00
David Robertson
220af1df54 Revert "Switch search SQL to triple-quote strings. (#14311)"
This reverts commit 81815e0561.
2022-11-02 12:28:24 +00:00
David Robertson
03ba8c83be Merge branch 'release-v1.71' into matrix-org-hotfixes 2022-11-01 12:48:12 +00:00
Olivier Wilkinson (reivilibre)
18a045ba69 Merge branch 'release-v1.70' into matrix-org-hotfixes 2022-10-28 12:27:04 +01:00
Olivier Wilkinson (reivilibre)
42dc734f85 Merge branch 'release-v1.70' into matrix-org-hotfixes 2022-10-24 17:10:50 +01:00
Erik Johnston
4398548556 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-10-19 10:29:02 +01:00
Erik Johnston
1235316645 Merge remote-tracking branch 'origin/release-v1.70' into matrix-org-hotfixes 2022-10-18 10:55:09 +01:00
Erik Johnston
aca3a117a9 Merge remote-tracking branch 'origin/release-v1.69' into matrix-org-hotfixes 2022-10-14 14:49:42 +01:00
Erik Johnston
382c9e9acd Merge remote-tracking branch 'origin/release-v1.69' into matrix-org-hotfixes 2022-10-11 16:43:00 +01:00
Sean Quah
3d5242da14 Merge remote-tracking branch 'origin/release-v1.69' into matrix-org-hotfixes 2022-10-06 15:04:49 +01:00
Sean Quah
dedd4cd061 Merge remote-tracking branch 'origin/release-v1.69' into matrix-org-hotfixes 2022-10-04 11:26:47 +01:00
Erik Johnston
a2b6ee7b00 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-09-30 14:27:14 +01:00
Erik Johnston
3f30bdca19 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-09-28 11:12:36 +01:00
Olivier Wilkinson (reivilibre)
f4419438c1 Merge branch 'release-v1.68' into matrix-org-hotfixes 2022-09-20 12:24:26 +01:00
Erik Johnston
3a5edde170 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-09-14 14:48:45 +01:00
Erik Johnston
9d2d3bdee6 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-09-06 09:01:48 +01:00
David Robertson
42374f46f5 Merge remote-tracking branch 'origin/release-v1.66' into matrix-org-hotfixes 2022-08-30 12:26:33 +01:00
David Robertson
ce8f7d118c Merge branch 'release-v1.66' into matrix-org-hotfixes 2022-08-23 12:41:34 +01:00
David Robertson
7ba0336010 Remove the hotfix-specific hack for auth on room_members
This reverts fae708c0e8.

We believe this to be unnecessary---other Synapse deployments do not
have this patch, and we are not aware of bridging problems as a result.

Related:

- https://github.com/matrix-org/matrix-appservice-irc/issues/506
- https://github.com/matrix-org/synapse/issues/4826
2022-08-23 11:31:19 +01:00
David Robertson
7c59528d54 Merge branch 'release-v1.66' into matrix-org-hotfixes 2022-08-23 10:23:40 +01:00
David Robertson
04b00974e5 Merge branch 'release-v1.66' into matrix-org-hotfixes 2022-08-23 10:21:42 +01:00
Andrew Morgan
80bf6da876 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-08-22 10:47:30 +01:00
Olivier Wilkinson (reivilibre)
aedc5b04b9 Merge branch 'develop' into matrix-org-hotfixes 2022-08-19 12:19:30 +01:00
Sean Quah
d20c92d2c2 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-08-18 16:27:31 +01:00
Erik Johnston
e91a929049 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-08-17 13:18:00 +01:00
Erik Johnston
7cd167f607 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-08-17 10:54:17 +01:00
Olivier Wilkinson (reivilibre)
d39ca69d0b Merge branch 'release-v1.65' into matrix-org-hotfixes 2022-08-11 11:42:17 +01:00
Olivier Wilkinson (reivilibre)
ba5d52f50c Merge branch 'release-v1.65' into matrix-org-hotfixes 2022-08-09 11:49:06 +01:00
Richard van der Hoff
08d6aa3340 Merge branch 'release-v1.64' into matrix-org-hotfixes 2022-07-29 12:32:03 +01:00
Olivier Wilkinson (reivilibre)
0a9bcc0313 Merge branch 'release-v1.64' into matrix-org-hotfixes 2022-07-26 13:05:49 +01:00
Erik Johnston
9d2dab8e7c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-07-25 10:41:03 +01:00
Erik Johnston
fa0fc4acce Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-07-22 10:26:35 +01:00
Sean Quah
54f2ebbea5 Merge remote-tracking branch 'origin/release-v1.63' into matrix-org-hotfixes 2022-07-12 13:15:53 +01:00
Erik Johnston
e808df9e2e Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-07-12 09:22:01 +01:00
Erik Johnston
8881bd77d4 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-07-06 12:11:24 +01:00
Andrew Morgan
860ed0e636 Merge remote-tracking branch 'origin/release-v1.62' into matrix-org-hotfixes 2022-07-04 16:18:49 +01:00
Erik Johnston
614f6ccb48 Merge remote-tracking branch 'origin/release-v1.62' into matrix-org-hotfixes 2022-06-30 15:09:39 +01:00
Andrew Morgan
f825db3d6c Merge remote-tracking branch 'origin/release-v1.62' into matrix-org-hotfixes 2022-06-28 17:02:40 +01:00
Erik Johnston
1bfb991453 Merge remote-tracking branch 'origin/release-v1.62' into matrix-org-hotfixes 2022-06-28 13:15:03 +01:00
Erik Johnston
b1ed0e044c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-06-17 10:52:07 +01:00
Olivier Wilkinson (reivilibre)
e3b00708bd Merge remote-tracking branch 'origin/release-v1.61' into matrix-org-hotfixes 2022-06-07 14:37:24 +01:00
Erik Johnston
d45a0af44d Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-06-06 14:12:06 +01:00
Erik Johnston
302491c81e Merge remote-tracking branch 'origin/release-v1.60' into matrix-org-hotfixes 2022-05-31 13:23:15 +01:00
Sean Quah
7335ab609e Merge remote-tracking branch 'origin/release-v1.60' into matrix-org-hotfixes 2022-05-27 11:12:13 +01:00
Sean Quah
4ff9477996 Merge remote-tracking branch 'origin/release-v1.60' into matrix-org-hotfixes 2022-05-24 12:09:40 +01:00
Brendan Abolivier
4cee2a6330 Fixup changelog 2022-05-18 12:23:37 +01:00
Brendan Abolivier
dc6e607edc Merge branch 'release-v1.59' into matrix-org-hotfixes 2022-05-18 11:46:34 +01:00
Erik Johnston
771d2041cd Fix query performance for /sync
Broke in #12729.
2022-05-16 15:50:05 +01:00
David Robertson
7b83ac8675 Merge remote-tracking branch 'origin/release-v1.59' into matrix-org-hotfixes 2022-05-16 12:55:19 +01:00
David Robertson
42f8b22ce2 Merge branch 'release-v1.59' into matrix-org-hotfixes 2022-05-10 11:34:30 +01:00
David Robertson
3ba5d67cb8 Merge branch 'release-v1.58' into matrix-org-hotfixes 2022-04-26 17:24:44 +01:00
David Robertson
474a964fb7 Merge remote-tracking branch 'origin/release-v1.58' into matrix-org-hotfixes 2022-04-26 12:04:34 +01:00
Andrew Morgan
a794ad17c2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2022-04-25 14:06:31 +01:00
Erik Johnston
8674fa3bc9 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-04-12 12:02:43 +01:00
Erik Johnston
27c2386b3d Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-04-07 15:55:46 +01:00
Erik Johnston
c37cd85d8a Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-04-07 13:34:23 +01:00
Sean Quah
5f814b2838 Merge remote-tracking branch 'origin/release-v1.56' into matrix-org-hotfixes 2022-04-05 14:12:18 +01:00
Erik Johnston
ee5377c9aa Merge branch 'erikj/prefill_device_list_change_cache' into matrix-org-hotfixes 2022-04-04 20:13:45 +01:00
Erik Johnston
ea2d01366c Newsfile 2022-04-04 19:13:58 +01:00
Erik Johnston
f986db2adb Newsfile 2022-04-04 19:08:42 +01:00
Erik Johnston
36383d48f3 Prefill the device_list_stream_cache 2022-04-04 19:07:49 +01:00
Erik Johnston
fd1b6334f0 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-03-29 10:15:25 +01:00
Andrew Morgan
895c12e421 Merge branch 'release-v1.55' of github.com:matrix-org/synapse into matrix-org-hotfixes 2022-03-22 10:38:46 +00:00
Olivier Wilkinson (reivilibre)
d4c9fa5dbd Merge branch 'release-v1.55' into matrix-org-hotfixes 2022-03-21 14:47:46 +00:00
David Robertson
b9bbbebc06 Merge remote-tracking branch 'origin/release-v1.55' into matrix-org-hotfixes 2022-03-17 11:05:45 +00:00
David Robertson
2207fa50b4 Merge branch 'release-v1.55' into matrix-org-hotfixes 2022-03-15 11:21:08 +00:00
Patrick Cloke
fdc1063782 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-03-10 10:38:28 -05:00
Olivier Wilkinson (reivilibre)
0203dcfe46 Merge branch 'release-v1.54', remote-tracking branch 'origin' into matrix-org-hotfixes 2022-03-08 10:56:20 +00:00
Olivier Wilkinson (reivilibre)
20e10495f6 Merge commit 'd8001' (pre v1.54.0rc1) into matrix-org-hotfixes 2022-03-02 11:18:09 +00:00
reivilibre
f1b625ad56 matrix.org hotfixes: Back out in-flight state cache changes (#12117) 2022-03-01 15:30:22 +00:00
Erik Johnston
3d92936c14 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2022-02-22 14:36:44 +00:00
Sean Quah
c5ba1d67b1 Merge branch 'release-v1.53' into matrix-org-hotfixes 2022-02-15 11:40:00 +00:00
David Robertson
ed2f158a38 Printf debugging for MSISDN validation (#11882)
This makes some attempt to keep CI happy too, but it probably ought not to.
2022-02-08 12:57:17 +00:00
reivilibre
3bf466698f Hotfixes: Revert commit() OpenTracing hackery (#11906) 2022-02-04 10:54:35 +00:00
David Robertson
6705391eec Merge branch 'release-v1.52' into matrix-org-hotfixes 2022-02-01 11:17:39 +00:00
Richard van der Hoff
2b9f741f3a Fix logic for dropping old events in fed queue
Fixes infinite loops of

> logger.info("Invalid prev_events for %s", event_id)
2022-01-23 21:09:17 +00:00
Olivier Wilkinson (reivilibre)
7977b7f6a8 Merge branch 'release-v1.51' into matrix-org-hotfixes 2022-01-21 10:49:43 +00:00
Andrew Morgan
d1e6333f12 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2022-01-19 12:44:55 +00:00
Andrew Morgan
20d4418485 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2022-01-19 10:59:51 +00:00
Olivier Wilkinson (reivilibre)
8e8a00829f Merge branch 'release-v1.50' into matrix-org-hotfixes 2022-01-14 10:51:50 +00:00
Richard van der Hoff
5cc41f1b05 Updates to opentracing hackery 2022-01-07 12:49:54 +00:00
Richard van der Hoff
99e7fb1d52 Wrap connection.commit with OpenTracing
This is an attempt to diagnose poor apdex levels, per
https://github.com/matrix-org/internal-config/issues/1181
2022-01-07 11:53:28 +00:00
Olivier Wilkinson (reivilibre)
1a776f6710 Merge branch 'release-v1.50' into matrix-org-hotfixes 2022-01-06 16:37:36 +00:00
Olivier Wilkinson (reivilibre)
717a5c085a Merge branch 'release-v1.50' into matrix-org-hotfixes 2022-01-05 14:19:39 +00:00
Richard van der Hoff
59544678a1 Merge branch 'rav/no_bundle_aggregations_in_sync' into matrix-org-hotfixes 2021-12-15 13:13:08 +00:00
Richard van der Hoff
a9c146ac53 Disable aggregation bundling on /sync responses
A partial revert of #11478. This turns out to have had a significant CPU impact
on initial-sync handling. For now, let's disable it, until we find a more
efficient way of achieving this.
2021-12-15 13:10:25 +00:00
Sean Quah
dbceb00688 Merge branch 'release-v1.49' into matrix-org-hotfixes 2021-12-07 13:57:18 +00:00
Brendan Abolivier
cb79a2b785 Merge branch 'develop' into matrix-org-hotfixes 2021-11-25 15:16:47 +00:00
David Robertson
098e964bbc Prevent the media store from writing outside of the configured directory
And the associated changelog/release process updates too.

Applied by patch from the security fork.
2021-11-23 10:14:27 +00:00
David Robertson
e147f067c5 Merge branch 'release-v1.47' into matrix-org-hotfixes 2021-11-23 10:09:27 +00:00
Andrew Morgan
ce06cb59c3 Merge branch 'release-v1.47' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-11-16 13:55:44 +00:00
Andrew Morgan
2a93005a7b Merge branch 'release-v1.47' into matrix-org-hotfixes 2021-11-15 11:52:32 +00:00
Olivier Wilkinson (reivilibre)
9d3b04e749 Merge branch 'release-v1.47' into matrix-org-hotfixes 2021-11-09 11:58:35 +00:00
Erik Johnston
459d2ae157 Merge remote-tracking branch 'origin/release-v1.46' into matrix-org-hotfixes 2021-11-02 10:04:06 +00:00
Erik Johnston
2bb023ba2b Don't seqscan event_json due to relates_to_id 2021-10-27 11:56:36 +01:00
Sean Quah
d8c1a21492 Merge branch 'release-v1.46' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-10-26 14:32:17 +01:00
Sean Quah
c59b9711f3 Merge branch 'release-v1.45' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-10-20 11:06:51 +01:00
David Robertson
27e6e45349 Merge branch 'release-v1.45' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-10-13 10:52:17 +01:00
Erik Johnston
2aacb49446 Merge remote-tracking branch 'origin/release-v1.45' into matrix-org-hotfixes 2021-10-12 14:27:34 +01:00
Brendan Abolivier
6ce0dc0620 Merge branch 'release-v1.45' into matrix-org-hotfixes 2021-10-12 10:21:26 +01:00
Brendan Abolivier
ebbd37b66d Merge branch 'release-v1.44' into matrix-org-hotfixes 2021-10-04 14:17:05 +01:00
Olivier Wilkinson (reivilibre)
4cb6ffdf46 Merge branch 'release-v1.44' into matrix-org-hotfixes 2021-09-30 11:43:38 +01:00
Erik Johnston
b9a0f7983d Merge remote-tracking branch 'origin/release-v1.44' into matrix-org-hotfixes 2021-09-28 14:37:06 +01:00
Erik Johnston
ba3a888a05 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-09-28 11:55:53 +01:00
David Robertson
a8340692ab Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-09-22 13:35:31 +01:00
Erik Johnston
2cc4c33d0a Merge remote-tracking branch 'origin/dmr/cache-eviction-hack' into matrix-org-hotfixes 2021-09-16 11:13:00 +01:00
Erik Johnston
bb0a4bd6d5 Merge remote-tracking branch 'origin/release-v1.43' into matrix-org-hotfixes 2021-09-16 11:12:52 +01:00
David Robertson
6227858482 Changelog 2021-09-15 17:22:21 +01:00
David Robertson
361ffb8f0a Don't expire get_users_who_share_room & friends 2021-09-15 17:22:17 +01:00
David Robertson
c9fb203ce0 Allow LruCaches to opt out of time-based expiry 2021-09-15 17:20:07 +01:00
Andrew Morgan
003c2ab629 Merge branch 'release-v1.43' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-09-14 11:02:37 +01:00
Richard van der Hoff
97ef48b07e Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-09-10 10:43:42 +01:00
Richard van der Hoff
dffdda5f89 Revert "Expand on why users should read upgrade notes"
This reverts commit 4d03ad5255.

This was committed to the wrong branch - it has been superceded by ca3cb1e039
on the release branches.
2021-09-10 10:42:14 +01:00
Brendan Abolivier
4d03ad5255 Expand on why users should read upgrade notes 2021-09-06 15:57:57 +01:00
Brendan Abolivier
92bbe0ebe1 Merge branch 'release-v1.42' into matrix-org-hotfixes 2021-09-06 15:38:03 +01:00
Andrew Morgan
ca2e5b2060 Merge branch 'release-v1.42' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-09-01 10:56:17 +01:00
Olivier Wilkinson (reivilibre)
3cd1277a7b Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-08-31 14:33:17 +01:00
Richard van der Hoff
619cc1d230 Merge branch 'release-v1.41' into matrix-org-hotfixes 2021-08-31 11:30:16 +01:00
Richard van der Hoff
ac646fed06 Remove some redundant patches from the hotfixes branch 2021-08-26 09:45:19 +01:00
Patrick Cloke
fe3466a8ad Merge remote-tracking branch 'origin/release-v1.41' into matrix-org-hotfixes 2021-08-20 07:53:27 -04:00
Andrew Morgan
2f4fe530a1 Merge branch 'release-v1.41' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-08-18 14:23:52 +01:00
Andrew Morgan
18572fddcc Merge branch 'release-v1.41' into matrix-org-hotfixes 2021-08-17 14:35:20 +01:00
Šimon Brandner
40e92b224c Handle string read receipt data (#10606)
* 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>
2021-08-16 12:23:15 +01:00
Brendan Abolivier
53d7d92511 Merge branch 'release-v1.40' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-08-09 11:32:41 +01:00
Brendan Abolivier
0dcc40e81a Merge branch 'release-v1.40' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-08-04 15:20:28 +01:00
Olivier Wilkinson (reivilibre)
11dda97e86 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-08-03 10:34:44 +01:00
Andrew Morgan
1d3a9fe6e5 Merge branch 'release-v1.39' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-07-28 10:36:55 +01:00
Erik Johnston
12c92eec18 Merge remote-tracking branch 'origin/release-v1.38' into matrix-org-hotfixes 2021-07-22 15:30:22 +01:00
Andrew Morgan
c0121d69e7 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-07-20 11:48:03 +01:00
Erik Johnston
cc07548d71 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-07-16 11:25:22 +01:00
Erik Johnston
8a2be4f799 Merge remote-tracking branch 'origin/release-v1.38' into matrix-org-hotfixes 2021-07-09 10:17:22 +01:00
Brendan Abolivier
fc8a586ab9 Merge branch 'release-v1.38' into matrix-org-hotfixes 2021-07-06 14:11:37 +01:00
Richard van der Hoff
7eea8de9de Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-07-01 08:59:54 +01:00
Richard van der Hoff
cfddd43bfb bump background update rate 2021-06-29 20:56:46 +01:00
Richard van der Hoff
d70eefc313 Merge branch 'release-v1.37' into matrix-org-hotfixes 2021-06-29 20:54:40 +01:00
Richard van der Hoff
b4bdab8e52 Revert "Don't send catchup transactions for matrix hq"
This reverts commits 5575b5cb43,
f271b32bea,
ffe17e47ce
2021-06-29 16:13:09 +01:00
Richard van der Hoff
b18d18d03b Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-29 12:49:50 +01:00
Richard van der Hoff
077d441d42 Merge branch 'develop' into matrix-org-hotfixes 2021-06-29 11:27:25 +01:00
Erik Johnston
ffe17e47ce Fix SQL 2021-06-28 14:29:27 +01:00
Erik Johnston
f271b32bea don't send out events for matrix.org 2021-06-28 14:17:56 +01:00
Erik Johnston
5575b5cb43 Don't send catchup transactions for matrix hq
This is because there are problems with HQ atm.
2021-06-28 14:12:48 +01:00
Brendan Abolivier
0bbdca814a Merge branch 'release-v1.37' into matrix-org-hotfixes 2021-06-24 10:58:19 +01:00
Brendan Abolivier
c80e8b98de Tweak changelog 2021-06-24 10:57:39 +01:00
Brendan Abolivier
a0e48edd2f Merge branch 'release-v1.37' into matrix-org-hotfixes 2021-06-24 09:41:28 +01:00
Brendan Abolivier
6f4c860c56 Merge branch 'release-v1.37' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-06-23 09:49:14 +01:00
Richard van der Hoff
89013b99bd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-16 15:35:00 +01:00
Erik Johnston
a4b573ee48 Merge branch 'release-v1.36' into matrix-org-hotfixes 2021-06-11 15:37:22 +01:00
Andrew Morgan
f6e1e48dcf Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-06-08 13:52:56 +01:00
Andrew Morgan
fc8bab8291 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-06-08 11:52:11 +01:00
Andrew Morgan
efc5febc33 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-06-08 11:21:03 +01:00
Richard van der Hoff
68d7704d19 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-07 16:57:58 +01:00
Richard van der Hoff
f36457dce2 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-04 10:41:36 +01:00
Patrick Cloke
09361655d2 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-06-02 11:38:54 -04:00
Erik Johnston
a027b65c8e Merge remote-tracking branch 'origin/release-v1.35' into matrix-org-hotfixes 2021-05-28 17:15:01 +01:00
Erik Johnston
d2fcfef679 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-27 17:11:57 +01:00
Erik Johnston
2d83d19061 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-25 10:23:00 +01:00
Erik Johnston
6942377f90 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-14 11:31:38 +01:00
Brendan Abolivier
019ed44b84 Merge branch 'release-v1.34.0' into matrix-org-hotfixes 2021-05-12 16:41:04 +01:00
Richard van der Hoff
b0b8110acd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-12 12:57:55 +01:00
Brendan Abolivier
ab717bceb5 Merge branch 'release-v1.33.2' into matrix-org-hotfixes 2021-05-11 10:49:58 +01:00
Brendan Abolivier
6157f02067 Revert "improve efficiency of _glob_to_re"
This reverts commit edac710bc0.
2021-05-11 10:49:45 +01:00
Erik Johnston
7865bc1dfb Always cache 'event_to_prev_state_group'
Fixes regression in send PDU times introduced in #9905.
2021-05-07 14:55:22 +01:00
Erik Johnston
e11cd368b7 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-06 15:07:28 +01:00
Erik Johnston
a8f48246b6 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-05-06 10:25:53 +01:00
Andrew Morgan
696e7df2e8 Merge branch 'release-v1.33.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-29 11:30:12 +01:00
Andrew Morgan
9979fef4fe Revert "Experimental Federation Speedup (#9702)"
This reverts commit 05e8c70c05.
2021-04-27 13:47:39 +01:00
Andrew Morgan
9773abf3d8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-27 13:46:16 +01:00
Richard van der Hoff
7b5022ee2e Merge remote-tracking branch 'origin/release-v1.32.2' into matrix-org-hotfixes 2021-04-21 16:43:10 +01:00
Richard van der Hoff
f21a46216f Merge branch 'release-v1.32.2' into matrix-org-hotfixes 2021-04-21 16:39:55 +01:00
Andrew Morgan
a468d19fd6 Merge branch 'release-v1.32.1' into matrix-org-hotfixes 2021-04-21 10:26:43 +01:00
Richard van der Hoff
edac710bc0 improve efficiency of _glob_to_re 2021-04-19 19:03:38 +01:00
Andrew Morgan
bf4ad8070e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-19 14:32:50 +01:00
Andrew Morgan
118e789e0c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-13 16:10:20 +01:00
Andrew Morgan
77866a5f5f Merge branch 'matrix-org-hotfixes' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-04-13 16:10:07 +01:00
Erik Johnston
053c8c019f Merge branch 'erikj/fix_stalled_catchup' into matrix-org-hotfixes 2021-04-08 18:05:22 +01:00
Patrick Cloke
fbcc8703dc Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-04-08 08:10:56 -04:00
Erik Johnston
f46b864748 Merge remote-tracking branch 'origin/release-v1.31.0' into matrix-org-hotfixes 2021-03-30 11:41:52 +01:00
Erik Johnston
2b8650547f Merge tag 'v1.30.1' into matrix-org-hotfixes
Synapse 1.30.1 (2021-03-26)
===========================

This release is identical to Synapse 1.30.0, with the exception of explicitly
setting a minimum version of Python's Cryptography library to ensure that users
of Synapse are protected from the recent [OpenSSL security advisories](https://mta.openssl.org/pipermail/openssl-announce/2021-March/000198.html),
especially CVE-2021-3449.

Note that Cryptography defaults to bundling its own statically linked copy of
OpenSSL, which means that you may not be protected by your operating system's
security updates.

It's also worth noting that Cryptography no longer supports Python 3.5, so
admins deploying to older environments may not be protected against this or
future vulnerabilities. Synapse will be dropping support for Python 3.5 at the
end of March.

Updates to the Docker image
---------------------------

- Ensure that the docker container has up to date versions of openssl. ([\#9697](https://github.com/matrix-org/synapse/issues/9697))

Internal Changes
----------------

- Enforce that `cryptography` dependency is up to date to ensure it has the most recent openssl patches. ([\#9697](https://github.com/matrix-org/synapse/issues/9697))
2021-03-26 14:44:31 +00:00
Erik Johnston
f36a060d2c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-24 16:13:19 +00:00
Richard van der Hoff
ea74189a90 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-24 12:45:54 +00:00
Andrew Morgan
05ec9e8d37 Revert "Patch to temporarily drop cross-user m.key_share_requests (#8675)" (#9668)
We patched `matrix-org-hotfixes` a little while ago in #8675 to drop any cross-user key share requests while they were being accidentally spammed by a client. This was a temporary fix until we had some rate-limiting in place.

Rate-limiting landed in https://github.com/matrix-org/synapse/pull/8957. Note that the rate-limit can't be configured, but has what appear to be [sensible defaults](db2efa9c50/synapse/config/ratelimiting.py (L105-L113)).

Note that the original patch was already actually overridden partially when the rate-limit PR landed, as they conflicted. So we've already lifted the restriction between local devices on matrix.org, but requests were still blocked from being sent over federation. This PR cleans up the remaining bits.

This reverts commit d60af9305a.
2021-03-23 10:53:05 +00:00
Andrew Morgan
6557eba7dc Revert "Patch to temporarily drop cross-user m.key_share_requests (#8675)"
This reverts commit d60af9305a.
2021-03-23 10:24:03 +00:00
Richard van der Hoff
d8953b34f2 Merge branch 'develop' into matrix-org-hotfixes 2021-03-16 12:42:54 +00:00
Richard van der Hoff
56c0c711c1 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-09 15:23:55 +00:00
Erik Johnston
61a970e25f Merge remote-tracking branch 'origin/release-v1.29.0' into matrix-org-hotfixes 2021-03-04 10:23:26 +00:00
Erik Johnston
50c242fa29 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-03 16:08:05 +00:00
Erik Johnston
8965291b87 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-03 12:12:15 +00:00
Erik Johnston
81c7b0515d Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-03-03 10:59:10 +00:00
Richard van der Hoff
fdbccc1e74 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-02-26 14:05:40 +00:00
Richard van der Hoff
0e56f02d5d Revert "Redirect redirect requests if they arrive on the wrong URI"
This reverts commit 5ee8a1c50a.

This has now been superceded on develop by PR #9436.
2021-02-26 14:05:00 +00:00
Richard van der Hoff
c7934aee2c Revert "more login hacking"
This reverts commit 47d2b49e2b.

This has now been superceded on develop by PR 9472.
2021-02-26 14:04:05 +00:00
Erik Johnston
5d405f7e7a Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-02-22 12:55:32 +00:00
Erik Johnston
5054eb291e Merge remote-tracking branch 'origin/release-v1.28.0' into matrix-org-hotfixes 2021-02-19 10:06:01 +00:00
Richard van der Hoff
47d2b49e2b more login hacking 2021-02-18 14:29:48 +00:00
Richard van der Hoff
1f507c2515 Merge branch 'rav/fix_cookie_path' into matrix-org-hotfixes
Merge the cookie fix to hotfixes
2021-02-18 14:03:43 +00:00
Richard van der Hoff
5ee8a1c50a Redirect redirect requests if they arrive on the wrong URI 2021-02-18 14:01:23 +00:00
Richard van der Hoff
7b7831bb63 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-02-17 16:31:57 +00:00
Erik Johnston
a4aa56a0eb Ensure that we never stop reconnecting to redis (#9391) 2021-02-11 17:39:56 +00:00
Patrick Cloke
fa0f99e4f2 Merge branch 'release-v1.27.0' into matrix-org-hotfixes 2021-02-11 11:30:16 -05:00
Richard van der Hoff
844b3e3f65 Revert "block groups requests to fosdem"
This reverts commit 3f6530ed55.
2021-02-06 12:03:46 +00:00
Richard van der Hoff
3f6530ed55 block groups requests to fosdem 2021-02-06 11:04:32 +00:00
Erik Johnston
25757a3d47 Merge branch 'erikj/media_spam_checker' into matrix-org-hotfixes 2021-02-05 10:13:55 +00:00
Erik Johnston
6e774373c2 Merge remote-tracking branch 'origin/release-v1.27.0' into matrix-org-hotfixes 2021-02-02 16:06:59 +00:00
Erik Johnston
512e313f18 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-26 14:15:26 +00:00
Patrick Cloke
a574751a87 Merge remote-tracking branch 'origin/release-v1.26.0' into matrix-org-hotfixes 2021-01-25 08:07:39 -05:00
Erik Johnston
bde75f5f66 Merge remote-tracking branch 'origin/release-v1.26.0' into matrix-org-hotfixes 2021-01-21 16:05:34 +00:00
Erik Johnston
e33124a642 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-20 10:45:19 +00:00
Erik Johnston
bed4fa29fd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-19 10:19:25 +00:00
Erik Johnston
f5ab7d8306 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-18 11:14:37 +00:00
Erik Johnston
029c9ef967 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-15 14:05:55 +00:00
Erik Johnston
e6b27b480c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-14 17:39:13 +00:00
Erik Johnston
43dc637136 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-14 15:29:29 +00:00
Erik Johnston
00c62b9d07 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-08 11:18:20 +00:00
Erik Johnston
82a91208d6 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-07 13:04:45 +00:00
Erik Johnston
91fd180be1 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2021-01-07 10:35:04 +00:00
Patrick Cloke
fb4a4f9f15 Merge branch 'release-v1.25.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2021-01-05 12:12:07 -05:00
Richard van der Hoff
5a4f09228d Remove cache from room directory query results
This reverts a285fe0. Hopefully the cache is no longer required, thanks to
2021-01-05 13:52:36 +00:00
Richard van der Hoff
97d12dcf56 Merge remote-tracking branch 'origin/release-v1.25.0' into matrix-org-hotfixes 2021-01-05 11:32:29 +00:00
Patrick Cloke
f4f65f4e99 Allow redacting events on workers (#8994)
Adds the redacts endpoint to workers that have the client listener.
2020-12-29 11:06:10 -05:00
Patrick Cloke
863359a04f Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-12-15 11:26:13 -05:00
Patrick Cloke
33a349df91 Merge branch 'develop' into matrix-org-hotfixes 2020-12-15 08:23:14 -05:00
Patrick Cloke
a41b1dc49f Merge branch 'release-v1.24.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-12-04 09:03:12 -05:00
Patrick Cloke
16744644f6 Merge branch 'release-v1.24.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-12-02 08:40:21 -05:00
Erik Johnston
dbf46f3891 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-11-27 10:25:17 +00:00
Erik Johnston
52984e9e69 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-11-13 12:05:55 +00:00
Richard van der Hoff
ce2107eee1 Merge branch 'rav/fix_sighup' into matrix-org-hotfixes 2020-10-31 10:54:23 +00:00
Richard van der Hoff
8373e6254f Fix SIGHUP handler
Fixes:

```
builtins.TypeError: _reload_logging_config() takes 1 positional argument but 2 were given
```
2020-10-31 10:53:12 +00:00
Erik Johnston
1ff3bc332a Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-30 12:08:09 +00:00
Andrew Morgan
172ddb3b45 Merge branch 'develop' into matrix-org-hotfixes
* develop:
  Don't unnecessarily start bg process in replication sending loop. (#8670)
  Don't unnecessarily start bg process while handling typing. (#8668)
2020-10-28 12:14:03 +00:00
Andrew Morgan
d60af9305a Patch to temporarily drop cross-user m.key_share_requests (#8675)
Cross-user `m.key_share_requests` are a relatively new `to_device` message that allows user to re-request session keys for a message from another user if they were otherwise unable to retrieve them.

Unfortunately, these have had performance concerns on matrix.org. This is a temporary patch to disable them while we investigate a better solution.
2020-10-28 11:58:47 +00:00
Erik Johnston
bcb6b243e9 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-27 14:13:14 +00:00
Erik Johnston
32457baa40 Merge branch 'release-v1.22.0' into matrix-org-hotfixes 2020-10-26 15:03:36 +00:00
Erik Johnston
ab4cd7f802 Merge remote-tracking branch 'origin/release-v1.21.3' into matrix-org-hotfixes 2020-10-22 09:57:06 +01:00
Erik Johnston
e9b5e642c3 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-10-16 11:34:53 +01:00
Erik Johnston
9250ee8650 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-14 13:32:07 +01:00
Richard van der Hoff
bdbe2b12c2 Revert "block membership events from spammy freenode bridge"
This reverts commit cd2f831b9d.
2020-10-13 17:10:45 +01:00
Erik Johnston
43bcb1e54e Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-13 13:29:50 +01:00
Richard van der Hoff
cd2f831b9d block membership events from spammy freenode bridge 2020-10-12 19:09:30 +01:00
Erik Johnston
4b43332131 Merge remote-tracking branch 'origin/release-v1.21.0' into matrix-org-hotfixes 2020-10-07 17:09:29 +01:00
Richard van der Hoff
77daff166d Merge remote-tracking branch 'origin/release-v1.21.0' into matrix-org-hotfixes 2020-10-02 12:32:26 +01:00
Richard van der Hoff
5ccc0785c1 Revert "fix remote thumbnails?"
This has now been fixed by a different commit (73d93039f).

This reverts commit b0a463f758.
2020-10-02 12:30:49 +01:00
Richard van der Hoff
b0a463f758 fix remote thumbnails? 2020-10-01 15:53:18 +01:00
Richard van der Hoff
8a8d01d732 Merge branch 'develop' into matrix-org-hotfixes 2020-10-01 15:07:33 +01:00
Richard van der Hoff
1c22954668 Revert "Temporary fix to ensure kde can contact matrix.org if stuff breaks"
This reverts commit d90b0946ed.

We believe this is no longer required.
2020-10-01 12:10:55 +01:00
Richard van der Hoff
e675bbcc49 Remove redundant EventCreationHandler._is_worker_app attribute
This was added in 1c347c84bf/#7544 as a temporary optimisation. That was never
merged to develop, since it conflicted with #7492. The merge cf92310da forgot
to remove it.
2020-10-01 11:51:57 +01:00
Richard van der Hoff
607367aeb1 Fix typo in comment
I think this came from a bad merge
2020-10-01 11:43:16 +01:00
Richard van der Hoff
ac6c5f198e Remove dangling changelog.d files
These result from PRs which were cherry-picked from release branches.
2020-10-01 11:31:07 +01:00
Richard van der Hoff
db13a8607e Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-10-01 11:22:36 +01:00
Richard van der Hoff
cfb3096e33 Revert federation-transaction-transmission backoff hacks
This reverts b852a8247, 15b2a5081, 28889d8da.

I don't think these patches are required any more, and if they are, they should
be on mainline, not hidden in our hotfixes branch. Let's try backing them out:
if that turns out to be an error, we can PR them properly.
2020-10-01 11:22:19 +01:00
Erik Johnston
7b6f857aa9 Merge remote-tracking branch 'origin/release-v1.20.0' into matrix-org-hotfixes 2020-09-22 10:11:01 +01:00
Erik Johnston
9eea5c43af Intelligently select extremities used in backfill. (#8349)
Instead of just using the most recent extremities let's pick the
ones that will give us results that the pagination request cares about,
i.e. pick extremities only if they have a smaller depth than the
pagination token.

This is useful when we fail to backfill an extremity, as we no longer
get stuck requesting that same extremity repeatedly.
2020-09-18 15:07:36 +01:00
Andrew Morgan
104c490274 Use _check_sigs_and_hash_and_fetch to validate backfill requests (#8350)
This is a bit of a hack, as `_check_sigs_and_hash_and_fetch` is intended
for attempting to pull an event from the database/(re)pull it from the
server that originally sent the event if checking the signature of the
event fails.

During backfill we *know* that we won't have the event in our database,
however it is still useful to be able to query the original sending
server as the server we're backfilling from may be acting maliciously.

The main benefit and reason for this change however is that
`_check_sigs_and_hash_and_fetch` will drop an event during backfill if
it cannot be successfully validated, whereas the current code will
simply fail the backfill request - resulting in the client's /messages
request silently being dropped.

This is a quick patch to fix backfilling rooms that contain malformed
events. A better implementation in planned in future.
2020-09-18 15:07:33 +01:00
Patrick Cloke
bbb7ca1f15 Merge remote-tracking branch 'origin/release-v1.19.2' into matrix-org-hotfixes 2020-09-16 08:21:05 -04:00
Patrick Cloke
27ef82d972 Merge remote-tracking branch 'origin/release-v1.20.0' into matrix-org-hotfixes 2020-09-11 07:34:53 -04:00
Richard van der Hoff
9df3a8a19f Merge branch 'release-v1.20.0' into matrix-org-hotfixes 2020-09-09 16:59:10 +01:00
Richard van der Hoff
5c4b13cd8f Merge remote-tracking branch 'origin/release-v1.20.0' into matrix-org-hotfixes 2020-09-07 17:00:02 +01:00
Richard van der Hoff
d74e8f2875 Merge branch 'release-v1.20.0' into matrix-org-hotfixes 2020-09-07 13:44:54 +01:00
Brendan Abolivier
cc23d81a74 Merge branch 'develop' into matrix-org-hotfixes 2020-09-04 11:02:10 +01:00
Brendan Abolivier
505ea932f5 Merge branch 'develop' into matrix-org-hotfixes 2020-09-03 15:30:00 +01:00
Richard van der Hoff
5f224a4794 Merge branch 'develop' into matrix-org-hotfixes 2020-08-28 15:59:57 +01:00
Patrick Cloke
3f488bfded Merge branch 'develop' into matrix-org-hotfixes 2020-08-27 10:16:21 -04:00
Richard van der Hoff
b4c1cfacc2 Merge branch 'develop' into matrix-org-hotfixes 2020-08-18 18:20:01 +01:00
Richard van der Hoff
afe4c4e02e Merge branch 'develop' into matrix-org-hotfixes 2020-08-18 18:13:47 +01:00
Brendan Abolivier
527f73d902 Merge branch 'develop' into matrix-org-hotfixes 2020-08-13 11:45:08 +01:00
Richard van der Hoff
82fec809a5 Merge branch 'develop' into matrix-org-hotfixes 2020-07-31 10:30:05 +01:00
Richard van der Hoff
b2ccc72a00 Merge branch 'release-v1.18.0' into matrix-org-hotfixes 2020-07-28 10:15:22 +01:00
Richard van der Hoff
be777e325d Merge branch 'develop' into matrix-org-hotfixes 2020-07-24 09:57:49 +01:00
Richard van der Hoff
25880bd441 Merge branch 'develop' into matrix-org-hotfixes 2020-07-09 12:49:39 +01:00
Richard van der Hoff
cc86fbc9ad Merge branch 'develop' into matrix-org-hotfixes 2020-07-09 11:06:52 +01:00
Patrick Cloke
bd30967bd7 Merge branch 'release-v1.15.2' into matrix-org-hotfixes 2020-07-02 10:08:07 -04:00
Andrew Morgan
8fed03aa3e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-07-01 11:12:28 +01:00
Andrew Morgan
ba66e3dfef Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-07-01 10:46:06 +01:00
Erik Johnston
199ab854d6 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-06-26 11:08:10 +01:00
Erik Johnston
c16bb06d25 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-06-25 09:39:01 +01:00
Erik Johnston
d06f4ab693 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-06-17 16:32:39 +01:00
Erik Johnston
8ba1086801 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-06-17 14:38:15 +01:00
Brendan Abolivier
fea4b1d6ad Merge branch 'release-v1.15.1' into matrix-org-hotfixes 2020-06-16 11:29:33 +01:00
Brendan Abolivier
ae91d50100 Merge branch 'release-v1.15.1' into matrix-org-hotfixes 2020-06-16 10:16:44 +01:00
Brendan Abolivier
0d29112624 Merge branch 'release-v1.15.0' into matrix-org-hotfixes 2020-06-11 13:43:55 +01:00
Brendan Abolivier
d6c7550cf5 Merge tag 'v1.15.0rc1' of github.com:matrix-org/synapse into matrix-org-hotfixes
Synapse 1.15.0rc1 (2020-06-09)
==============================

Features
--------

- Advertise support for Client-Server API r0.6.0 and remove related unstable feature flags. ([\#6585](https://github.com/matrix-org/synapse/issues/6585))
- Add an option to disable autojoining rooms for guest accounts. ([\#6637](https://github.com/matrix-org/synapse/issues/6637))
- For SAML authentication, add the ability to pass email addresses to be added to new users' accounts via SAML attributes. Contributed by Christopher Cooper. ([\#7385](https://github.com/matrix-org/synapse/issues/7385))
- Add admin APIs to allow server admins to manage users' devices. Contributed by @dklimpel. ([\#7481](https://github.com/matrix-org/synapse/issues/7481))
- Add support for generating thumbnails for WebP images. Previously, users would see an empty box instead of preview image. ([\#7586](https://github.com/matrix-org/synapse/issues/7586))
- Support the standardized `m.login.sso` user-interactive authentication flow. ([\#7630](https://github.com/matrix-org/synapse/issues/7630))

Bugfixes
--------

- Allow new users to be registered via the admin API even if the monthly active user limit has been reached. Contributed by @dkimpel. ([\#7263](https://github.com/matrix-org/synapse/issues/7263))
- Fix email notifications not being enabled for new users when created via the Admin API. ([\#7267](https://github.com/matrix-org/synapse/issues/7267))
- Fix str placeholders in an instance of `PrepareDatabaseException`. Introduced in Synapse v1.8.0. ([\#7575](https://github.com/matrix-org/synapse/issues/7575))
- Fix a bug in automatic user creation during first time login with `m.login.jwt`. Regression in v1.6.0. Contributed by @olof. ([\#7585](https://github.com/matrix-org/synapse/issues/7585))
- Fix a bug causing the cross-signing keys to be ignored when resyncing a device list. ([\#7594](https://github.com/matrix-org/synapse/issues/7594))
- Fix metrics failing when there is a large number of active background processes. ([\#7597](https://github.com/matrix-org/synapse/issues/7597))
- Fix bug where returning rooms for a group would fail if it included a room that the server was not in. ([\#7599](https://github.com/matrix-org/synapse/issues/7599))
- Fix duplicate key violation when persisting read markers. ([\#7607](https://github.com/matrix-org/synapse/issues/7607))
- Prevent an entire iteration of the device list resync loop from failing if one server responds with a malformed result. ([\#7609](https://github.com/matrix-org/synapse/issues/7609))
- Fix exceptions when fetching events from a remote host fails. ([\#7622](https://github.com/matrix-org/synapse/issues/7622))
- Make `synctl restart` start synapse if it wasn't running. ([\#7624](https://github.com/matrix-org/synapse/issues/7624))
- Pass device information through to the login endpoint when using the login fallback. ([\#7629](https://github.com/matrix-org/synapse/issues/7629))
- Advertise the `m.login.token` login flow when OpenID Connect is enabled. ([\#7631](https://github.com/matrix-org/synapse/issues/7631))
- Fix bug in account data replication stream. ([\#7656](https://github.com/matrix-org/synapse/issues/7656))

Improved Documentation
----------------------

- Update the OpenBSD installation instructions. ([\#7587](https://github.com/matrix-org/synapse/issues/7587))
- Advertise Python 3.8 support in `setup.py`. ([\#7602](https://github.com/matrix-org/synapse/issues/7602))
- Add a link to `#synapse:matrix.org` in the troubleshooting section of the README. ([\#7603](https://github.com/matrix-org/synapse/issues/7603))
- Clarifications to the admin api documentation. ([\#7647](https://github.com/matrix-org/synapse/issues/7647))

Internal Changes
----------------

- Convert the identity handler to async/await. ([\#7561](https://github.com/matrix-org/synapse/issues/7561))
- Improve query performance for fetching state from a PostgreSQL database. ([\#7567](https://github.com/matrix-org/synapse/issues/7567))
- Speed up processing of federation stream RDATA rows. ([\#7584](https://github.com/matrix-org/synapse/issues/7584))
- Add comment to systemd example to show postgresql dependency. ([\#7591](https://github.com/matrix-org/synapse/issues/7591))
- Refactor `Ratelimiter` to limit the amount of expensive config value accesses. ([\#7595](https://github.com/matrix-org/synapse/issues/7595))
- Convert groups handlers to async/await. ([\#7600](https://github.com/matrix-org/synapse/issues/7600))
- Clean up exception handling in `SAML2ResponseResource`. ([\#7614](https://github.com/matrix-org/synapse/issues/7614))
- Check that all asynchronous tasks succeed and general cleanup of `MonthlyActiveUsersTestCase` and `TestMauLimit`. ([\#7619](https://github.com/matrix-org/synapse/issues/7619))
- Convert `get_user_id_by_threepid` to async/await. ([\#7620](https://github.com/matrix-org/synapse/issues/7620))
- Switch to upstream `dh-virtualenv` rather than our fork for Debian package builds. ([\#7621](https://github.com/matrix-org/synapse/issues/7621))
- Update CI scripts to check the number in the newsfile fragment. ([\#7623](https://github.com/matrix-org/synapse/issues/7623))
- Check if the localpart of a Matrix ID is reserved for guest users earlier in the registration flow, as well as when responding to requests to `/register/available`. ([\#7625](https://github.com/matrix-org/synapse/issues/7625))
- Minor cleanups to OpenID Connect integration. ([\#7628](https://github.com/matrix-org/synapse/issues/7628))
- Attempt to fix flaky test: `PhoneHomeStatsTestCase.test_performance_100`. ([\#7634](https://github.com/matrix-org/synapse/issues/7634))
- Fix typos of `m.olm.curve25519-aes-sha2` and `m.megolm.v1.aes-sha2` in comments, test files. ([\#7637](https://github.com/matrix-org/synapse/issues/7637))
- Convert user directory, state deltas, and stats handlers to async/await. ([\#7640](https://github.com/matrix-org/synapse/issues/7640))
- Remove some unused constants. ([\#7644](https://github.com/matrix-org/synapse/issues/7644))
- Fix type information on `assert_*_is_admin` methods. ([\#7645](https://github.com/matrix-org/synapse/issues/7645))
- Convert registration handler to async/await. ([\#7649](https://github.com/matrix-org/synapse/issues/7649))
2020-06-10 10:57:26 +01:00
Brendan Abolivier
4cf4c7dc99 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-06-01 12:58:34 +02:00
Erik Johnston
6fdf5ef66b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-29 13:27:12 +01:00
Brendan Abolivier
d4220574a2 Merge branch 'release-v1.14.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-28 14:12:46 +02:00
Erik Johnston
1a9c8d5ee9 Merge commit 'ef3934ec8f123f6f553b07471588fbcc7f444cd8' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-27 20:06:41 +01:00
Erik Johnston
407dbf8574 Merge branch 'release-v1.14.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-27 13:35:15 +01:00
Erik Johnston
8beca8e21f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-26 09:43:21 +01:00
Erik Johnston
cf92310da2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-21 15:19:00 +01:00
Richard van der Hoff
89f795fe8a Merge branch 'rav/matrix_hacks' into matrix-org-hotfixes 2020-05-20 23:40:22 +01:00
Richard van der Hoff
1c347c84bf inline some config references 2020-05-20 23:33:13 +01:00
Richard van der Hoff
0d8fb99cdf Merge branch 'rav/matrix_hacks' into matrix-org-hotfixes 2020-05-20 22:18:21 +01:00
Richard van der Hoff
b3a9ad124c Fix field name in stubbed out presence servlet 2020-05-20 22:17:59 +01:00
Richard van der Hoff
a902468354 Merge branch 'rav/matrix_hacks' into matrix-org-hotfixes 2020-05-20 22:13:44 +01:00
Richard van der Hoff
84639b32ae stub out GET presence requests 2020-05-20 22:13:32 +01:00
Patrick Cloke
dac5d5ae42 Merge branch 'release-v1.13.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-05-18 10:27:51 -04:00
Richard van der Hoff
6bd2a39a7d Merge branch 'release-v1.13.0' into matrix-org-hotfixes 2020-05-14 10:08:45 +01:00
Richard van der Hoff
309e30bae3 Merge remote-tracking branch 'origin/release-v1.13.0' into matrix-org-hotfixes 2020-05-11 13:09:14 +01:00
Richard van der Hoff
7ff7a415d1 Revert emergency registration patches
Revert "Merge commit '4d3ebc' into matrix-org-hotfixes"

This reverts commit 617541c4c6, reversing
changes made to ae4f6140f1.
2020-05-11 13:08:48 +01:00
Richard van der Hoff
6610343332 Revert emergency registration patches
Revert "Merge remote-tracking branch 'origin/clokep/no-validate-ui-auth-sess' into matrix-org-hotfixes"

This reverts commit 5adad58d95, reversing
changes made to 617541c4c6.
2020-05-11 13:08:14 +01:00
Richard van der Hoff
5adad58d95 Merge remote-tracking branch 'origin/clokep/no-validate-ui-auth-sess' into matrix-org-hotfixes 2020-05-07 15:19:54 +01:00
Patrick Cloke
d7c7f64f17 Propagate changes to the client dict to the database. 2020-05-07 10:07:09 -04:00
Patrick Cloke
c4c84b67d5 Disable a failing test. 2020-05-07 10:05:00 -04:00
Richard van der Hoff
617541c4c6 Merge commit '4d3ebc' into matrix-org-hotfixes 2020-05-07 14:16:52 +01:00
Patrick Cloke
4d3ebc3620 Disable validation that a UI authentication session has not been modified during a request cycle.
Partial backout of 1c1242acba (#7068)
2020-05-07 08:34:14 -04:00
Richard van der Hoff
ae4f6140f1 Merge branch 'release-v1.13.0' into matrix-org-hotfixes 2020-05-07 10:42:56 +01:00
Richard van der Hoff
323cfe3efb fix bad merge 2020-05-06 12:14:01 +01:00
Richard van der Hoff
b0d2add89d Merge branch 'rav/cross_signing_keys_cache' into matrix-org-hotfixes 2020-05-06 11:59:41 +01:00
Richard van der Hoff
ff20747703 Merge branch 'release-v1.13.0' into matrix-org-hotfixes 2020-05-06 11:57:36 +01:00
Richard van der Hoff
9192f1b9dd Merge rav/upsert_for_device_list into matrix-org-hotfixes 2020-05-06 11:46:19 +01:00
Richard van der Hoff
89d178e8e7 Merge rav/fix_dropped_messages into matrix-org-hotfixes 2020-05-05 22:42:48 +01:00
Richard van der Hoff
1c24e35e85 Merge erikj/faster_device_lists_fetch into matrix-org-hotfixes 2020-05-05 18:36:17 +01:00
Erik Johnston
5debf3071c Fix redis password support 2020-05-04 16:44:21 +01:00
Richard van der Hoff
e9bd4bb388 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-05-01 09:26:57 +01:00
Richard van der Hoff
649e48a799 Merge branch 'develop' into matrix-org-hotfixes 2020-04-24 14:07:47 +01:00
Richard van der Hoff
9b0157686b Merge branch 'release-v1.12.4' into matrix-org-hotfixes 2020-04-22 13:30:35 +01:00
Richard van der Hoff
8288218b29 Merge remote-tracking branch 'origin/release-v1.12.4' into matrix-org-hotfixes 2020-04-21 11:03:32 +01:00
Richard van der Hoff
da5e6eea45 Revert recent merges of #7289 into matrix-org-hotfixes
This was incorrectly merged before it was ready.

This reverts commit aead826d2d, reversing
changes made to 4cd2a4ae3a.

It also reverts commits 9b8212d25, fb3f1fb5c and 2fdfa96ee.
2020-04-21 11:00:57 +01:00
Andrew Morgan
2fdfa96ee6 lint 2020-04-17 17:38:36 +01:00
Andrew Morgan
fb3f1fb5c0 Fix log lines, return type, tuple handling 2020-04-17 17:36:53 +01:00
Andrew Morgan
9b8212d256 Update changelog 2020-04-17 17:36:24 +01:00
Andrew Morgan
aead826d2d Merge branch 'release-v1.12.4' of github.com:matrix-org/synapse into matrix-org-hotfixes
* 'release-v1.12.4' of github.com:matrix-org/synapse:
  Query missing cross-signing keys on local sig upload
2020-04-17 15:49:31 +01:00
Andrew Morgan
4cd2a4ae3a Merge branch 'release-v1.12.4' into HEAD
* release-v1.12.4:
  Only register devices edu handler on the master process (#7255)
  tweak changelog
  1.12.3
  Fix the debian build in a better way. (#7212)
  Fix changelog wording
  1.12.2
  Pin Pillow>=4.3.0,<7.1.0 to fix dep issue
  1.12.1
2020-04-14 13:36:19 +01:00
Andrew Morgan
66cd243e6f Merge branch 'release-v1.12.1' of github.com:matrix-org/synapse into matrix-org-hotfixes
* 'release-v1.12.1' of github.com:matrix-org/synapse:
  Note where bugs were introduced
  1.12.1rc1
  Newsfile
  Rewrite changelog
  Add changelog
  Only import sqlite3 when type checking
  Fix another instance
  Only setdefault for signatures if device has key_json
  Fix starting workers when federation sending not split out.
  matrix.org was fine
  Update CHANGES.md
  changelog typos
  1.12.0 changelog
  1.12.0
  more changelog
  changelog fixes
  fix typo
  1.12.0rc1
  update grafana dashboard
2020-03-31 12:06:11 +01:00
Richard van der Hoff
7b66a1f0d9 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-03-19 10:29:20 +00:00
Richard van der Hoff
059e91bdce Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-03-19 10:03:10 +00:00
Erik Johnston
f86962cb6b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-03-18 17:17:03 +00:00
Brendan Abolivier
03c694bb08 Fix schema deltas 2020-03-12 16:48:11 +00:00
Brendan Abolivier
08d68c5296 Populate the room version from state events
See `rooms_version_column_3.sql.postgres` for details about why we need to do
that.
2020-03-12 15:59:24 +00:00
Brendan Abolivier
568461b5ec Also don't filter out events sent by ignored users when checking state visibility 2020-03-11 17:04:18 +00:00
Brendan Abolivier
6b73b8b70c Fix condition 2020-03-11 15:32:07 +00:00
Brendan Abolivier
936686ed2d Don't filter out events when we're checking the visibility of state 2020-03-11 15:21:25 +00:00
Brendan Abolivier
74050d0c1c Merge branch 'develop' into matrix-org-hotfixes 2020-03-09 15:06:56 +00:00
Richard van der Hoff
69111a8b2a Merge branch 'develop' into matrix-org-hotfixes 2020-02-27 10:46:36 +00:00
Richard van der Hoff
d840ee5bde Revert "skip send without trailing slash"
I think this was done back when most synapses would reject the
no-trailing-slash version; it's no longer required, and makes matrix.org spec-incompliant.

This reverts commit fc5be50d56.
2020-02-27 10:44:55 +00:00
Erik Johnston
e3d811e85d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-19 15:48:33 +00:00
Erik Johnston
578ad9fc48 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-19 15:11:20 +00:00
Richard van der Hoff
9dbe34f0d0 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-02-19 11:40:25 +00:00
Erik Johnston
93a0751302 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-19 10:16:46 +00:00
Erik Johnston
bc936b5657 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-18 16:11:26 +00:00
Richard van der Hoff
d6eae548a7 Merge branch 'release-v1.10.0' into matrix-org-hotfixes 2020-02-11 10:43:32 +00:00
Richard van der Hoff
e439438b9b Merge branch 'release-v1.10.0' into matrix-org-hotfixes 2020-02-10 09:56:51 +00:00
Richard van der Hoff
f8a1e0d1d2 Merge branch 'release-v1.10.0' into matrix-org-hotfixes 2020-02-10 09:54:40 +00:00
Erik Johnston
8a29def84a Add support for putting fed user query API on workers (#6873) 2020-02-07 15:59:05 +00:00
Erik Johnston
77a166577a Allow moving group read APIs to workers (#6866) 2020-02-07 13:57:07 +00:00
Erik Johnston
7d5268d37c Merge branch 'release-v1.10.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-02-06 10:26:39 +00:00
Erik Johnston
c854d255e5 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-31 15:06:16 +00:00
Brendan Abolivier
c660962d4d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-22 13:48:11 +00:00
Richard van der Hoff
767bef0033 Merge branch 'rav/storage_provider_debug' into matrix-org-hotfixes 2020-01-21 23:03:22 +00:00
Richard van der Hoff
4d02bfd6e1 a bit of debugging for media storage providers 2020-01-21 23:02:58 +00:00
Andrew Morgan
a099ab7d38 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-14 10:37:32 +00:00
Erik Johnston
ce72a9ccdb Merge branch 'erikj/media_admin_apis' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-08 15:52:58 +00:00
Erik Johnston
bace86ed15 Merge branch 'release-v1.8.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-08 15:52:48 +00:00
Erik Johnston
45bf455948 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2020-01-07 14:24:36 +00:00
Richard van der Hoff
859663565c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2020-01-06 15:43:41 +00:00
Richard van der Hoff
0876a5b641 Merge branch 'release-v1.7.3' into matrix-org-hotfixes 2019-12-31 10:47:29 +00:00
Richard van der Hoff
5b5314ee41 Merge branch 'release-v1.7.2' into matrix-org-hotfixes 2019-12-20 10:48:04 +00:00
Richard van der Hoff
aff9189149 Merge remote-tracking branch 'origin/release-v1.7.1' into matrix-org-hotfixes 2019-12-17 16:00:43 +00:00
Richard van der Hoff
2eda49a8db Merge remote-tracking branch 'origin/release-v1.7.1' into matrix-org-hotfixes 2019-12-17 10:56:36 +00:00
Richard van der Hoff
96b17d4e4f Merge remote-tracking branch 'origin/release-v1.7.0' into matrix-org-hotfixes 2019-12-17 10:56:26 +00:00
Erik Johnston
aadc131dc1 Merge branch 'babolivier/pusher-room-store' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-12-10 12:50:04 +00:00
Neil Johnson
0a522121a0 Merge branch 'release-v1.7.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-12-10 11:25:28 +00:00
Andrew Morgan
0b5e2c8093 Merge branch 'release-v1.6.1' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-28 11:40:33 +00:00
Erik Johnston
c665d154a2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-26 18:56:54 +00:00
Neil Johnson
31295b5a60 Merge branch 'release-v1.6.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-26 13:16:18 +00:00
Erik Johnston
aebe20c452 Fix phone home stats (#6418)
Fix phone home stats
2019-11-26 13:10:09 +00:00
Andrew Morgan
508e0f9310 1.6.0 2019-11-26 12:15:46 +00:00
Andrew Morgan
e04e7e830e Merge branch 'release-v1.6.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-26 12:06:38 +00:00
Andrew Morgan
5407e69732 Change /push/v1/notify IP to 10.103.0.7 2019-11-26 12:04:19 +00:00
Erik Johnston
2c59eb368c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-20 15:17:10 +00:00
Erik Johnston
6d1a3e2bdd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-11-19 12:59:39 +00:00
Richard van der Hoff
7fa4586e36 Merge branch 'rav/url_preview_limit_title_2' into matrix-org-hotfixes 2019-11-05 18:18:02 +00:00
Erik Johnston
33b4aa8d99 Merge branch 'release-v1.5.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-29 12:18:44 +00:00
Erik Johnston
627cf5def8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-25 11:35:14 +01:00
Erik Johnston
b409d51dee Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-25 10:19:09 +01:00
Erik Johnston
4a4e620f30 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-11 10:40:15 +01:00
Richard van der Hoff
28889d8da5 fix logging 2019-10-11 09:57:18 +01:00
Richard van der Hoff
15b2a50817 Add some randomness to the high-cpu backoff hack 2019-10-11 09:15:56 +01:00
Richard van der Hoff
b852a8247d Awful hackery to try to get the fed sender to keep up
Basically, if the federation sender starts getting behind, insert some sleeps
into the transaction transmission code to give the fed sender a chance to catch
up.

Might have to experiment a bit with the numbers.
2019-10-10 10:34:08 +01:00
Erik Johnston
7b55cca011 Merge branch 'erikj/cache_memberships' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-07 13:15:22 +01:00
Richard van der Hoff
a9577ab1f4 Merge branch 'develop' into matrix-org-hotfixes 2019-10-03 17:52:22 +01:00
Richard van der Hoff
cb217d5d60 Revert "Awful hackery to try to get the fed sender to keep up"
This reverts commit 721086a291.

This didn't help.
2019-10-03 17:05:24 +01:00
Andrew Morgan
f4f5355bcf Merge branch 'release-v1.4.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-03 13:06:32 +01:00
Erik Johnston
23bb2713d2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-02 16:51:08 +01:00
Erik Johnston
b2471e1109 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-02 15:39:31 +01:00
Erik Johnston
610219d53d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-02 14:09:29 +01:00
Erik Johnston
b464afe283 Merge branch 'release-v1.4.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-10-02 11:09:05 +01:00
Richard van der Hoff
7657ad3ced Merge branch 'rav/federation_sender_hackery' into matrix-org-hotfixes 2019-09-27 16:14:52 +01:00
Richard van der Hoff
721086a291 Awful hackery to try to get the fed sender to keep up
Basically, if the federation sender starts getting behind, insert some sleeps
into the transaction transmission code to give the fed sender a chance to catch
up.

Might have to experiment a bit with the numbers.
2019-09-27 16:13:51 +01:00
Richard van der Hoff
6e6b53ed3a Merge branch 'develop' into matrix-org-hotfixes 2019-09-26 15:22:33 +01:00
Richard van der Hoff
601b50672d Merge branch 'develop' into matrix-org-hotfixes 2019-09-25 12:48:40 +01:00
Richard van der Hoff
a7af389da0 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-09-24 17:05:15 +01:00
Neil Johnson
99db0d76fd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-24 14:56:12 +01:00
Richard van der Hoff
561b0f79bc Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-09-24 10:11:19 +01:00
Richard van der Hoff
8569f3cdef Merge branch 'rav/fix_retry_reset' into matrix-org-hotfixes 2019-09-20 12:14:19 +01:00
Richard van der Hoff
7b61e6f5d6 Merge branch 'develop' into matrix-org-hotfixes 2019-09-18 13:55:25 +01:00
Richard van der Hoff
05241b3031 Revert "Fix m.federate bug"
This has now been merged into develop (142c9325c) so we no longer need this
cherry-picked commit.

This reverts commit ee91c69ef7.
2019-09-18 13:54:57 +01:00
Richard van der Hoff
e01026d84d Revert "Fix existing v2 identity server calls (MSC2140) (#6013)"
This has now been merged into develop (3505ffcda) so we don't need this
cherry-picked commit.

This reverts commit e0eef47315.
2019-09-18 13:53:37 +01:00
Erik Johnston
ee91c69ef7 Fix m.federate bug 2019-09-13 14:44:48 +01:00
Andrew Morgan
e0eef47315 Fix existing v2 identity server calls (MSC2140) (#6013)
Two things I missed while implementing [MSC2140](https://github.com/matrix-org/matrix-doc/pull/2140/files#diff-c03a26de5ac40fb532de19cb7fc2aaf7R80).

1. Access tokens should be provided to the identity server as `access_token`, not `id_access_token`, even though the homeserver may accept the tokens as `id_access_token`.
2. Access tokens must be sent to the identity server in a query parameter, the JSON body is not allowed.

We now send the access token as part of an `Authorization: ...` header, which fixes both things.

The breaking code was added in https://github.com/matrix-org/synapse/pull/5892

Sytest PR: https://github.com/matrix-org/sytest/pull/697
2019-09-13 14:08:26 +01:00
Erik Johnston
44d2ca2990 Merge branch 'anoa/fix_3pid_validation' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-10 18:15:24 +01:00
Erik Johnston
9240622c1a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-06 14:10:53 +01:00
Erik Johnston
0dbba85e95 Merge branch 'anoa/worker_store_reg' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-06 13:02:12 +01:00
Andrew Morgan
1ceeccb769 Move get_threepid_validation_session into RegistrationWorkerStore 2019-09-06 13:00:34 +01:00
Erik Johnston
39883e85bd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-06 12:50:28 +01:00
Erik Johnston
68f53b7a0e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-06 09:53:37 +01:00
Erik Johnston
e679b008ff Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-05 15:23:40 +01:00
Erik Johnston
e80a5b7492 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-09-04 13:13:30 +01:00
Richard van der Hoff
b272e7345f Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-08-30 12:01:24 +01:00
Erik Johnston
a81e0233e9 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-29 11:18:57 +01:00
Richard van der Hoff
80898481ab Merge branch 'release-v1.3.1' into matrix-org-hotfixes 2019-08-17 09:22:30 +01:00
Brendan Abolivier
9d4c716d85 Merge branch 'release-v1.3.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-15 11:36:00 +01:00
Brendan Abolivier
d90b0946ed Temporary fix to ensure kde can contact matrix.org if stuff breaks 2019-08-13 18:05:06 +01:00
Brendan Abolivier
8d5762b0dc Merge branch 'release-v1.3.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-13 17:39:30 +01:00
Brendan Abolivier
a7efbc5416 Merge branch 'release-v1.3.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-13 15:54:01 +01:00
Richard van der Hoff
be362cb8f8 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-08-13 10:52:19 +01:00
Erik Johnston
873ff9522b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-08-01 14:46:09 +01:00
Erik Johnston
c1ee2999a0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-31 10:01:56 +01:00
Erik Johnston
9b2b386f76 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-30 13:26:19 +01:00
Erik Johnston
65fe31786d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-30 10:12:13 +01:00
Andrew Morgan
70b6d1dfd6 Merge branch 'release-v1.2.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-24 13:32:41 +01:00
Erik Johnston
ee62aed72e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-23 10:23:40 +01:00
Erik Johnston
c02f26319d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-23 09:20:26 +01:00
Andrew Morgan
fdd182870c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-22 10:19:16 +01:00
Richard van der Hoff
4102cb220a Merge branch 'release-v1.2.0' into matrix-org-hotfixes 2019-07-18 15:20:00 +01:00
Erik Johnston
5299707329 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-07-17 10:56:55 +01:00
Richard van der Hoff
43e01be158 Merge remote-tracking branch 'origin/release-v1.1.0' into matrix-org-hotfixes 2019-07-03 09:49:35 +01:00
Richard van der Hoff
589e080c6b Merge branch 'release-v1.1.0' into matrix-org-hotfixes 2019-07-03 09:47:55 +01:00
Richard van der Hoff
24e48bc9ff Merge branch 'release-v1.1.0' into matrix-org-hotfixes 2019-07-02 12:05:33 +01:00
Erik Johnston
576b62a6a3 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-28 10:04:54 +01:00
Erik Johnston
ad2ba70959 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-24 15:31:36 +01:00
Erik Johnston
a330505025 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-21 14:36:13 +01:00
Erik Johnston
67b73fd147 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-21 13:27:04 +01:00
Erik Johnston
c08e4dbadc Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-17 14:10:28 +01:00
Erik Johnston
6dbd498772 Merge branch 'master' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-11 17:25:54 +01:00
Erik Johnston
03b09b32d6 Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-11 14:00:50 +01:00
Erik Johnston
8f1711da0e Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-11 00:23:54 +01:00
Erik Johnston
6fb6c98f71 Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-10 18:34:45 +01:00
Erik Johnston
aad993f24d Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-10 16:05:10 +01:00
Erik Johnston
544e101c24 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-06-04 16:58:38 +01:00
Richard van der Hoff
8699f380f0 hotfix RetryLimiter 2019-06-04 12:14:41 +01:00
Richard van der Hoff
e91a68ef3a Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-06-04 11:59:55 +01:00
Richard van der Hoff
9f5048c198 Merge branch 'rav/limit_displayname_length' into matrix-org-hotfixes 2019-06-01 11:15:43 +01:00
Erik Johnston
b3c40ba58a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-05-31 10:58:47 +01:00
Erik Johnston
8d69193a42 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-05-30 14:33:44 +01:00
Erik Johnston
bbcd19f2d0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-05-24 10:53:01 +01:00
Erik Johnston
3cd598135f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-05-23 15:54:13 +01:00
Richard van der Hoff
1c8f2c34ff Merge branch 'develop' into matrix-org-hotfixes 2019-05-21 16:29:25 +01:00
Richard van der Hoff
ca03f90ee7 Merge branch 'develop' into matrix-org-hotfixes 2019-05-20 15:55:39 +01:00
Richard van der Hoff
9feee29d76 Merge tag 'v0.99.4rc1' into matrix-org-hotfixes
v0.99.4rc1
2019-05-14 11:12:22 +01:00
Richard van der Hoff
e7dcee13da Merge commit 'a845abbf3' into matrix-org-hotfixes 2019-05-03 17:12:28 +01:00
Richard van der Hoff
7467738834 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2019-05-02 13:37:35 +01:00
Erik Johnston
d75fb8ae22 Merge branch 'erikj/ratelimit_3pid_invite' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-26 18:12:33 +01:00
Erik Johnston
ae25a8efef Merge branch 'erikj/postpath' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-17 10:14:57 +01:00
Richard van der Hoff
fc5be50d56 skip send without trailing slash 2019-04-16 15:16:57 +01:00
Erik Johnston
aadba440da Point pusher to new box 2019-04-15 19:23:21 +01:00
Erik Johnston
ec94d6a590 VersionRestServlet doesn't take a param 2019-04-15 19:21:32 +01:00
Erik Johnston
42ce90c3f7 Merge branch 'erikj/move_endpoints' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-15 18:56:46 +01:00
Erik Johnston
8467756dc1 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-04 14:43:57 +01:00
Erik Johnston
613b443ff0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-04-02 18:25:45 +01:00
Richard van der Hoff
233b61ac61 Remove spurious changelog files from hotfixes
The relevant patches are now in develop thanks to
https://github.com/matrix-org/synapse/pull/4816.
2019-04-02 13:51:37 +01:00
Richard van der Hoff
f41c9d37d6 Merge branch 'develop' into matrix-org-hotfixes 2019-04-02 13:47:08 +01:00
Neil Johnson
1048e2ca6a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-27 09:18:35 +00:00
Richard van der Hoff
ce0ce1add3 Merge branch 'develop' into matrix-org-hotfixes 2019-03-25 16:48:56 +00:00
Erik Johnston
b0bf1ea7bd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-21 14:10:31 +00:00
Richard van der Hoff
2561b628af Merge branch 'develop' into matrix-org-hotfixes 2019-03-19 12:19:20 +00:00
Richard van der Hoff
73c6630718 Revert "Reinstate EDU-batching hacks"
This reverts commit ed8ccc3737.
2019-03-19 12:17:28 +00:00
Erik Johnston
a189bb03ab Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-14 14:39:06 +00:00
Erik Johnston
404a2d70be Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-14 13:55:29 +00:00
Richard van der Hoff
ed8ccc3737 Reinstate EDU-batching hacks
This reverts commit c7285607a3.
2019-03-13 14:42:11 +00:00
Erik Johnston
18b1a92162 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-08 09:56:17 +00:00
Amber Brown
199aa72d35 Merge branch 'develop' of ssh://github.com/matrix-org/synapse into
matrix-org-hotfixes
2019-03-07 21:43:10 +11:00
Erik Johnston
8f7dbbc14a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-06 19:30:30 +00:00
Erik Johnston
27dbc9ac42 Reenable presence tests and remove pointless change 2019-03-06 17:12:45 +00:00
Richard van der Hoff
e9aa401994 Remove redundant changes from synapse/replication/tcp/streams.py (#4813)
This was some hacky code (introduced in c10c71e70d) to make the presence stream
do nothing on hotfixes. We now ensure that no replication clients subscribe to
the presence stream, so this is redundant.
2019-03-06 13:21:32 +00:00
Richard van der Hoff
9e9572c79e Run black on synapse/handlers/user_directory.py (#4812)
This got done on the develop branch in #4635, but the subsequent merge to
hotfixes (88af0317a) discarded the changes for some reason.

Fixing this here and now means (a) there are fewer differences between
matrix-org-hotfixes and develop, making future patches easier to merge, and (b)
fixes some pep8 errors on the hotfixes branch which have been annoying me for
some time.
2019-03-06 11:56:03 +00:00
Richard van der Hoff
c7285607a3 Revert EDU-batching hacks from matrix-org-hotfixes
Firstly: we want to do this in a better way, which is the intention of
too many RRs, which means we need to make it happen again.

This reverts commits: 8d7c0264b 000d23090 eb0334b07 4d07dc0d1
2019-03-06 11:04:53 +00:00
Erik Johnston
a6e2546980 Fix outbound federation 2019-03-05 14:50:37 +00:00
Erik Johnston
dc510e0e43 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-03-05 14:41:13 +00:00
Richard van der Hoff
ed12338f35 Remove #4733 debug (#4767)
We don't need any of this stuff now; this brings protocol.py back into line
with develop for the hotfixes branch.
2019-03-04 14:00:03 +00:00
Richard van der Hoff
bf3f8b8855 Add more debug for #4422 (#4769) 2019-02-28 17:46:22 +00:00
Richard van der Hoff
67acd1aa1b Merge branch 'develop' into matrix-org-hotfixes 2019-02-27 10:29:24 +00:00
Erik Johnston
75c924430e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-26 09:36:29 +00:00
Richard van der Hoff
6087c53830 Add more debug for membership syncing issues (#4719) 2019-02-25 17:00:18 +00:00
Erik Johnston
b50fe65a22 Add logging when sending error 2019-02-25 15:55:21 +00:00
Erik Johnston
17009e689b Merge pull request #4734 from matrix-org/rav/repl_debug
Add some debug to help with #4733
2019-02-25 15:52:45 +00:00
Richard van der Hoff
5d2f755d3f Add some debug to help with #4733 2019-02-25 14:37:23 +00:00
Richard van der Hoff
8d7c0264bc more fix edu batching hackery 2019-02-24 23:27:52 +00:00
Richard van der Hoff
000d230901 fix edu batching hackery 2019-02-24 23:19:37 +00:00
Richard van der Hoff
eb0334b07c more edu batching hackery 2019-02-24 23:15:09 +00:00
Richard van der Hoff
4d07dc0d18 Add a delay to the federation loop for EDUs 2019-02-24 22:24:36 +00:00
Erik Johnston
0ea52872ab Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-22 15:29:41 +00:00
Richard van der Hoff
6868d53fe9 bail out early in on_new_receipts if no pushers 2019-02-21 15:58:15 +00:00
Richard van der Hoff
68af15637b Merge branch 'develop' into matrix-org-hotfixes 2019-02-20 14:24:17 +00:00
Richard van der Hoff
4da63d9f6f Merge branch 'develop' into matrix-org-hotfixes 2019-02-20 14:15:56 +00:00
Richard van der Hoff
085d69b0bd Apply the pusher http hack in the right place (#4692)
Do it in the constructor, so that it works for badge updates as well as pushes
2019-02-20 11:25:10 +00:00
Erik Johnston
776fe6c184 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-20 09:52:24 +00:00
Erik Johnston
0e07d2c7d5 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-19 13:24:37 +00:00
Erik Johnston
90ec885805 Revert "Merge pull request #4654 from matrix-org/hawkowl/registration-worker"
This reverts commit 5bd2e2c31d, reversing
changes made to d97c3a6ce6.
2019-02-19 13:23:17 +00:00
Erik Johnston
5a28154c4d Revert "Merge pull request #4655 from matrix-org/hawkowl/registration-worker"
This reverts commit 93555af5c9, reversing
changes made to 5bd2e2c31d.
2019-02-19 13:23:14 +00:00
Erik Johnston
2fcb51e703 Merge branch 'matthew/well-known-cors' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-18 18:38:49 +00:00
Erik Johnston
26f524872f Revert change that cached connection factory 2019-02-18 18:36:54 +00:00
Erik Johnston
88af0317a2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-15 22:39:13 +00:00
Erik Johnston
c10c71e70d Emergency changes 2019-02-15 18:15:21 +00:00
Erik Johnston
93555af5c9 Merge pull request #4655 from matrix-org/hawkowl/registration-worker
Device replication
2019-02-15 18:12:49 +00:00
Amber Brown
06622e4110 fix 2019-02-16 05:11:09 +11:00
Amber Brown
155efa9e36 fix 2019-02-16 05:10:48 +11:00
Amber Brown
3175edc5d8 maybe 2019-02-16 05:09:08 +11:00
Amber Brown
d95252c01f use a device replication thingy 2019-02-16 05:08:58 +11:00
Erik Johnston
5bd2e2c31d Merge pull request #4654 from matrix-org/hawkowl/registration-worker
Registration worker
2019-02-15 17:51:34 +00:00
Amber Brown
84528e4fb2 cleanup 2019-02-16 04:49:09 +11:00
Amber Brown
e4381ed514 pep8 2019-02-16 04:42:04 +11:00
Amber Brown
d9235b9e29 fix appservice, add to frontend proxy 2019-02-16 04:39:49 +11:00
Amber Brown
ce5f3b1ba5 add all the files 2019-02-16 04:35:58 +11:00
Amber Brown
7b5c04312e isort 2019-02-16 04:35:27 +11:00
Amber Brown
f5bafd70f4 add cache remover endpoint and wire it up 2019-02-16 04:34:23 +11:00
Richard van der Hoff
d97c3a6ce6 Merge remote-tracking branch 'origin/release-v0.99.1' into matrix-org-hotfixes 2019-02-13 14:29:05 +00:00
Erik Johnston
341c35614a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-02-13 10:29:31 +00:00
Richard van der Hoff
fecf28319c Merge branch 'release-v0.99.0' into matrix-org-hotfixes 2019-02-01 13:29:31 +00:00
Richard van der Hoff
345d8cfb69 Merge branch 'release-v0.99.0' into matrix-org-hotfixes 2019-02-01 13:21:42 +00:00
Richard van der Hoff
b60d005156 Merge branch 'develop' into matrix-org-hotfixes 2019-01-31 18:44:04 +00:00
Richard van der Hoff
6c232a69df Revert "Break infinite loop on redaction in v3 rooms"
We've got a better fix of this now.

This reverts commit decb5698b3.
2019-01-31 18:43:49 +00:00
Amber Brown
e97c1df30c remove slow code on userdir (#4534) 2019-01-31 13:26:38 +00:00
Richard van der Hoff
decb5698b3 Break infinite loop on redaction in v3 rooms 2019-01-31 00:23:58 +00:00
Erik Johnston
62962e30e4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-30 17:04:08 +00:00
Erik Johnston
05413d4e20 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-30 14:27:19 +00:00
Erik Johnston
ca46dcf683 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-30 13:11:25 +00:00
Erik Johnston
d351be1567 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-30 11:48:29 +00:00
Andrew Morgan
c7f2eaf4f4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-29 10:07:13 +00:00
Andrew Morgan
53d25116df Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-25 14:33:14 +00:00
Andrew Morgan
08e25ffa0c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-24 15:51:59 +00:00
Andrew Morgan
1c148e442b Merge branch 'anoa/room_dir_quick_fix' into matrix-org-hotfixes 2019-01-24 15:37:16 +00:00
Andrew Morgan
acaca1b4e9 Merge branch 'anoa/room_dir_quick_fix' into matrix-org-hotfixes 2019-01-24 14:51:35 +00:00
Andrew Morgan
4777836b83 Fix missing synapse metrics import 2019-01-23 15:26:03 +00:00
Andrew Morgan
7da659dd6d Use existing stream position counter metric 2019-01-23 15:04:12 +00:00
Andrew Morgan
77dfe51aba Name metric consistently 2019-01-23 15:04:05 +00:00
Andrew Morgan
ef7865e2f2 Track user_dir current event stream position 2019-01-23 15:03:54 +00:00
Matthew Hodgson
5cb15c0443 warn if we ignore device lists 2019-01-15 22:11:46 +00:00
Matthew Hodgson
b43172ffbc Merge pull request #4396 from matrix-org/matthew/bodge_device_update_dos
limit remote device lists to 10000 entries per user
2019-01-15 21:47:00 +00:00
Matthew Hodgson
b4796d1814 drop the limit to 1K as e2e will be hosed beyond that point anyway 2019-01-15 21:46:29 +00:00
Matthew Hodgson
482d06774a don't store remote device lists if they have more than 10K devices 2019-01-15 21:38:07 +00:00
Matthew Hodgson
046d731fbd limit remote device lists to 1000 entries per user 2019-01-15 21:07:12 +00:00
Richard van der Hoff
892f6c98ec Merge tag 'v0.34.1.1' into matrix-org-hotfixes
Synapse 0.34.1.1 (2019-01-11)
=============================

This release fixes CVE-2019-5885 and is recommended for all users of Synapse 0.34.1.

This release is compatible with Python 2.7 and 3.5+. Python 3.7 is fully supported.

Bugfixes
--------

- Fix spontaneous logout on upgrade
  ([\#4374](https://github.com/matrix-org/synapse/issues/4374))
2019-01-11 10:21:18 +00:00
Erik Johnston
7fafa2d954 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2019-01-09 09:13:16 +00:00
Richard van der Hoff
1d63046542 Merge tag 'v0.34.1rc1' into matrix-org-hotfixes
Synapse 0.34.1rc1 (2019-01-08)
==============================

Features
--------

- Special-case a support user for use in verifying behaviour of a given server. The support user does not appear in user directory or monthly active user counts. ([\#4141](https://github.com/matrix-org/synapse/issues/4141), [\#4344](https://github.com/matrix-org/synapse/issues/4344))
- Support for serving .well-known files ([\#4262](https://github.com/matrix-org/synapse/issues/4262))
- Rework SAML2 authentication ([\#4265](https://github.com/matrix-org/synapse/issues/4265), [\#4267](https://github.com/matrix-org/synapse/issues/4267))
- SAML2 authentication: Initialise user display name from SAML2 data ([\#4272](https://github.com/matrix-org/synapse/issues/4272))
- Synapse can now have its conditional/extra dependencies installed by pip. This functionality can be used by using `pip install matrix-synapse[feature]`, where feature is a comma separated list with the possible values `email.enable_notifs`, `matrix-synapse-ldap3`, `postgres`, `resources.consent`, `saml2`, `url_preview`, and `test`. If you want to install all optional dependencies, you can use "all" instead. ([\#4298](https://github.com/matrix-org/synapse/issues/4298), [\#4325](https://github.com/matrix-org/synapse/issues/4325), [\#4327](https://github.com/matrix-org/synapse/issues/4327))
- Add routes for reading account data. ([\#4303](https://github.com/matrix-org/synapse/issues/4303))
- Add opt-in support for v2 rooms ([\#4307](https://github.com/matrix-org/synapse/issues/4307))
- Add a script to generate a clean config file ([\#4315](https://github.com/matrix-org/synapse/issues/4315))
- Return server data in /login response ([\#4319](https://github.com/matrix-org/synapse/issues/4319))

Bugfixes
--------

- Fix contains_url check to be consistent with other instances in code-base and check that value is an instance of string. ([\#3405](https://github.com/matrix-org/synapse/issues/3405))
- Fix CAS login when username is not valid in an MXID ([\#4264](https://github.com/matrix-org/synapse/issues/4264))
- Send CORS headers for /media/config ([\#4279](https://github.com/matrix-org/synapse/issues/4279))
- Add 'sandbox' to CSP for media reprository ([\#4284](https://github.com/matrix-org/synapse/issues/4284))
- Make the new landing page prettier. ([\#4294](https://github.com/matrix-org/synapse/issues/4294))
- Fix deleting E2E room keys when using old SQLite versions. ([\#4295](https://github.com/matrix-org/synapse/issues/4295))
- The metric synapse_admin_mau:current previously did not update when config.mau_stats_only was set to True ([\#4305](https://github.com/matrix-org/synapse/issues/4305))
- Fixed per-room account data filters ([\#4309](https://github.com/matrix-org/synapse/issues/4309))
- Fix indentation in default config ([\#4313](https://github.com/matrix-org/synapse/issues/4313))
- Fix synapse:latest docker upload ([\#4316](https://github.com/matrix-org/synapse/issues/4316))
- Fix test_metric.py compatibility with prometheus_client 0.5. Contributed by Maarten de Vries <maarten@de-vri.es>. ([\#4317](https://github.com/matrix-org/synapse/issues/4317))
- Avoid packaging _trial_temp directory in -py3 debian packages ([\#4326](https://github.com/matrix-org/synapse/issues/4326))
- Check jinja version for consent resource ([\#4327](https://github.com/matrix-org/synapse/issues/4327))
- fix NPE in /messages by checking if all events were filtered out ([\#4330](https://github.com/matrix-org/synapse/issues/4330))
- Fix `python -m synapse.config` on Python 3. ([\#4356](https://github.com/matrix-org/synapse/issues/4356))

Deprecations and Removals
-------------------------

- Remove the deprecated v1/register API on Python 2. It was never ported to Python 3. ([\#4334](https://github.com/matrix-org/synapse/issues/4334))

Internal Changes
----------------

- Getting URL previews of IP addresses no longer fails on Python 3. ([\#4215](https://github.com/matrix-org/synapse/issues/4215))
- drop undocumented dependency on dateutil ([\#4266](https://github.com/matrix-org/synapse/issues/4266))
- Update the example systemd config to use a virtualenv ([\#4273](https://github.com/matrix-org/synapse/issues/4273))
- Update link to kernel DCO guide ([\#4274](https://github.com/matrix-org/synapse/issues/4274))
- Make isort tox check print diff when it fails ([\#4283](https://github.com/matrix-org/synapse/issues/4283))
- Log room_id in Unknown room errors ([\#4297](https://github.com/matrix-org/synapse/issues/4297))
- Documentation improvements for coturn setup. Contributed by Krithin Sitaram. ([\#4333](https://github.com/matrix-org/synapse/issues/4333))
- Update pull request template to use absolute links ([\#4341](https://github.com/matrix-org/synapse/issues/4341))
- Update README to not lie about required restart when updating TLS certificates ([\#4343](https://github.com/matrix-org/synapse/issues/4343))
- Update debian packaging for compatibility with transitional package ([\#4349](https://github.com/matrix-org/synapse/issues/4349))
- Fix command hint to generate a config file when trying to start without a config file ([\#4353](https://github.com/matrix-org/synapse/issues/4353))
- Add better logging for unexpected errors while sending transactions ([\#4358](https://github.com/matrix-org/synapse/issues/4358))
2019-01-08 11:37:25 +00:00
Richard van der Hoff
4c238a9a91 Merge remote-tracking branch 'origin/release-v0.34.0' into matrix-org-hotfixes 2018-12-19 10:24:26 +00:00
Richard van der Hoff
002db39a36 Merge tag 'v0.34.0rc1' into matrix-org-hotfixes 2018-12-04 14:07:28 +00:00
Richard van der Hoff
c4074e4ab6 Revert "Merge branch 'rav/timestamp_patch' into matrix-org-hotfixes"
This reverts commit 7960e814e5, reversing
changes made to 3dd704ee9a.

We no longer need this; please redo it as a proper MSC & synapse PR if you want
to keep it...
2018-12-03 10:15:39 +00:00
Richard van der Hoff
7960e814e5 Merge branch 'rav/timestamp_patch' into matrix-org-hotfixes 2018-11-30 12:10:30 +00:00
Richard van der Hoff
080025e533 Fix buglet and remove thread_id stuff 2018-11-30 12:09:33 +00:00
Richard van der Hoff
9accd63a38 Initial patch from Erik 2018-11-30 12:04:38 +00:00
Richard van der Hoff
3dd704ee9a Merge branch 'develop' into matrix-org-hotfixes 2018-11-20 11:29:45 +00:00
Richard van der Hoff
28e28a1974 Merge branch 'develop' into matrix-org-hotfixes 2018-11-20 11:03:35 +00:00
Richard van der Hoff
b699178aa1 Merge branch 'develop' into matrix-org-hotfixes 2018-11-14 11:54:29 +00:00
Richard van der Hoff
c08c649fa1 Merge remote-tracking branch 'origin/erikj/fix_device_comparison' into matrix-org-hotfixes 2018-11-08 12:48:19 +00:00
hera
5c0c4b4079 Fix encoding error for consent form on python3
The form was rendering this as "b'01234....'".

-- richvdh
2018-11-08 11:03:39 +00:00
Richard van der Hoff
b55cdfaa31 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-11-08 10:47:56 +00:00
Richard van der Hoff
34406cf22c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-11-06 10:49:20 +00:00
Amber Brown
f91aefd245 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-31 04:41:03 +11:00
Erik Johnston
f8281f42c8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-10-29 18:16:58 +00:00
Amber Brown
7171bdf279 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-29 23:14:47 +11:00
Erik Johnston
9f2d14ee26 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-10-26 09:52:23 +01:00
Amber Brown
ead471e72d Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-22 22:18:02 +11:00
Richard van der Hoff
9a4011de46 Merge branch 'develop' into matrix-org-hotfixes 2018-10-18 16:37:01 +01:00
Amber Brown
33551be61b Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-15 20:15:27 +11:00
Richard van der Hoff
eeb29d99fd Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-09 09:49:08 +01:00
Richard van der Hoff
1a0c407e6b Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-10-09 09:47:37 +01:00
Erik Johnston
c4b37cbf18 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-10-02 16:44:57 +01:00
Erik Johnston
7fa156af80 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-10-02 14:39:30 +01:00
Richard van der Hoff
78825f4f1c Merge branch 'develop' into matrix-org-hotfixes 2018-09-26 13:27:33 +01:00
Richard van der Hoff
6e15b5debe Revert "Actuall set cache factors in workers"
This reverts commit e21c312e16.
2018-09-26 13:25:52 +01:00
Matthew Hodgson
2e0d2879d0 Merge branch 'develop' into matrix-org-hotfixes 2018-09-26 11:00:26 +01:00
Michael Kaye
128043072b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-24 11:20:10 +01:00
Erik Johnston
b2fda9d20e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-20 11:00:14 +01:00
Erik Johnston
3c8c5eabc2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-15 11:40:37 +01:00
Erik Johnston
2da2041e2e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-14 19:56:33 +01:00
Erik Johnston
b5eef203f4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-14 18:25:55 +01:00
Erik Johnston
df73da691f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-13 16:15:56 +01:00
Matthew Hodgson
30d054e0bb Merge branch 'develop' into matrix-org-hotfixes 2018-09-12 17:16:21 +01:00
Erik Johnston
ebb3cc4ab6 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-12 11:22:06 +01:00
Erik Johnston
17201abd53 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-09-11 14:17:33 +01:00
Erik Johnston
2f141f4c41 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-22 11:47:08 +01:00
Richard van der Hoff
638c0bf49b Merge branch 'rav/fix_gdpr_consent' into matrix-org-hotfixes 2018-08-21 22:54:35 +01:00
hera
d1065e6f51 Merge tag 'v0.33.3rc2' into matrix-org-hotfixes
Bugfixes
--------

- Fix bug in v0.33.3rc1 which caused infinite loops and OOMs
([\#3723](https://github.com/matrix-org/synapse/issues/3723))
2018-08-21 19:12:14 +00:00
Erik Johnston
567863127a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-20 13:34:47 +01:00
Erik Johnston
f5abc10724 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-20 11:12:18 +01:00
Erik Johnston
bb795b56da Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-16 15:51:16 +01:00
Erik Johnston
4dd0604f61 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-15 15:37:05 +01:00
Richard van der Hoff
c05d278ba0 Merge branch 'rav/federation_metrics' into matrix-org-hotfixes 2018-08-07 19:11:29 +01:00
Erik Johnston
49a3163958 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-06 13:33:54 +01:00
Erik Johnston
1a568041fa Merge branch 'release-v0.33.1' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-08-02 15:28:32 +01:00
Erik Johnston
c9db8b0c32 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-24 17:22:23 +01:00
Erik Johnston
aa1bf10b91 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-24 15:49:38 +01:00
Erik Johnston
5222907bea Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-23 17:54:41 +01:00
Erik Johnston
e1eb147f2a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-23 16:45:22 +01:00
hera
e43eb47c5f Fixup limiter 2018-07-23 15:22:47 +00:00
hera
27eb4c45cd Lower hacky timeout for member limiter 2018-07-23 15:16:36 +00:00
Erik Johnston
b136d7ff8f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-23 16:09:40 +01:00
Richard van der Hoff
9e56e1ab30 Merge branch 'develop' into matrix-org-hotfixes 2018-07-19 16:40:28 +01:00
Erik Johnston
742f757337 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-19 10:26:13 +01:00
Richard van der Hoff
2f5dfe299c Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-07-17 15:26:47 +01:00
Erik Johnston
e4eec87c6a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-17 11:18:39 +01:00
Erik Johnston
f793ff4571 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-17 10:04:33 +01:00
Richard van der Hoff
195aae2f16 Merge branch 'develop' into matrix-org-hotfixes 2018-07-12 12:09:25 +01:00
Erik Johnston
7c79f2cb72 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-12 09:59:58 +01:00
Richard van der Hoff
f04e35c170 Merge branch 'develop' into matrix-org-hotfixes 2018-07-10 18:04:03 +01:00
Matthew Hodgson
36bbac05bd Merge branch 'develop' of git+ssh://github.com/matrix-org/synapse into matrix-org-hotfixes 2018-07-06 19:21:09 +01:00
Erik Johnston
e2a4b7681e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-07-05 10:29:32 +01:00
Erik Johnston
957944eee4 Merge pull request #3476 from matrix-org/erikj/timeout_memberships
Timeout membership requests after 90s
2018-07-03 10:18:39 +01:00
Erik Johnston
bf425e533e Fix PEP8 2018-07-03 10:11:09 +01:00
Erik Johnston
ca21957b8a Timeout membership requests after 90s
This is a hacky fix to try and stop in flight requests from building up
2018-07-02 13:56:08 +01:00
Erik Johnston
6a95270671 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-29 14:10:29 +01:00
hera
82781f5838 Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes 2018-06-28 21:09:28 +00:00
Matthew Hodgson
aae6d3ff69 Merge remote-tracking branch 'origin/revert-3451-hawkowl/sorteddict-api' into matrix-org-hotfixes 2018-06-26 18:36:29 +01:00
Matthew Hodgson
9175225adf Merge remote-tracking branch 'origin/hawkowl/sorteddict-api' into matrix-org-hotfixes 2018-06-26 17:52:37 +01:00
David Baker
7a32fa0101 Fix error on deleting users pending deactivation
Use simple_delete instead of simple_delete_one as commented
2018-06-26 11:57:44 +01:00
Erik Johnston
d46450195b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-25 20:14:34 +01:00
Erik Johnston
c0128c1021 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-25 20:12:13 +01:00
Erik Johnston
3320b7c9a4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-25 15:23:18 +01:00
Erik Johnston
4c22c9b0b6 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2018-06-25 14:37:13 +01:00
Richard van der Hoff
6d6ea1bb40 Merge branch 'develop' into matrix-org-hotfixes 2018-06-22 16:35:37 +01:00
aphrodite
9e38981ae4 Send HTTP pushes direct to http-priv rather than via clouldflare
(This is a heinous hack that ought to be made more generic and pushed back to develop)
2018-06-22 15:58:15 +01:00
hera
463e7c2709 Lower member limiter 2018-06-22 15:58:15 +01:00
Richard van der Hoff
ce9d0b1d0c Fix earlier logging patch
`@cached` doesn't work on decorated functions, because it uses inspection on
the target to calculate the number of arguments.
2018-06-22 15:58:15 +01:00
Richard van der Hoff
80786d5caf Logging for get_users_in_room 2018-06-22 15:58:15 +01:00
Richard van der Hoff
e18378c3e2 Increase member limiter to 20
Let's see if this makes the bridges go faster, or if it kills the synapse
master.
2018-06-22 15:58:15 +01:00
hera
0ca2857baa increase sync cache to 2 minutes
to give synchrotrons being hammered by repeating initial /syncs to get more
chance to actually complete and avoid a DoS
2018-06-22 15:58:15 +01:00
Erik Johnston
e21c312e16 Actuall set cache factors in workers 2018-06-22 15:58:15 +01:00
Richard van der Hoff
1031bd25f8 Avoid doing presence updates on replication reconnect
Presence is supposed to be disabled on matrix.org, so we shouldn't send a load
of USER_SYNC commands every time the synchrotron reconnects to the master.
2018-06-22 15:58:15 +01:00
hera
fae708c0e8 Disable auth on room_members for now
because the moznet bridge is broken (https://github.com/matrix-org/matrix-appservice-irc/issues/506)
2018-06-22 15:58:15 +01:00
Erik Johnston
8f8ea91eef Bump LAST_SEEN_GRANULARITY in client_ips 2018-06-22 15:58:15 +01:00
Erik Johnston
7a1406d144 Prefill client_ip_last_seen in replication 2018-06-22 15:58:15 +01:00
Erik Johnston
6373874833 Move event sending to end in shutdown room admin api 2018-06-22 15:58:15 +01:00
Erik Johnston
a79823e64b Add dummy presence REST handler to frontend proxy
The handler no-ops all requests as presence is disabled.
2018-06-22 15:58:15 +01:00
Erik Johnston
1766a5fdc0 Increase MAX_EVENTS_BEHIND for replication clients 2018-06-22 15:58:14 +01:00
Erik Johnston
e6b1ea3eb2 Disable presence in txn queue 2018-06-22 15:58:14 +01:00
Erik Johnston
e5537cf983 Limit concurrent AS joins 2018-06-22 15:58:14 +01:00
Erik Johnston
43bb12e640 Disable presence
This reverts commit 0ebd376a53 and
disables presence a bit more
2018-06-22 15:58:14 +01:00
Erik Johnston
66dcbf47a3 Disable auto search for prefixes in event search 2018-06-22 15:58:14 +01:00
Erik Johnston
a285fe05fd Add timeout to ResponseCache of /public_rooms 2018-06-22 15:58:14 +01:00
13 changed files with 679 additions and 302 deletions

16
Cargo.lock generated
View File

@@ -80,6 +80,12 @@ dependencies = [
"subtle",
]
[[package]]
name = "either"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]]
name = "generic-array"
version = "0.14.6"
@@ -102,6 +108,15 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adab1eaa3408fb7f0c777a73e7465fd5656136fc93b670eb6df3c88c2c1344e3"
[[package]]
name = "itertools"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57"
dependencies = [
"either",
]
[[package]]
name = "itoa"
version = "1.0.4"
@@ -402,6 +417,7 @@ dependencies = [
"anyhow",
"blake2",
"hex",
"itertools",
"lazy_static",
"log",
"pyo3",

View File

@@ -23,6 +23,7 @@ name = "synapse.synapse_rust"
[dependencies]
anyhow = "1.0.63"
itertools = "0.11.0"
lazy_static = "1.4.0"
log = "0.4.17"
pyo3 = { version = "0.19.2", features = [

596
rust/src/db.rs Normal file
View File

@@ -0,0 +1,596 @@
// Copyright 2023 The Matrix.org Foundation C.I.C.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::{
cmp::max,
collections::{BTreeSet, HashMap, HashSet},
};
use itertools::Itertools;
use log::info;
use pyo3::{
intern, types::PyModule, wrap_pyfunction, FromPyObject, IntoPy, PyAny, PyObject, PyResult,
Python,
};
use pyo3::prelude::*;
pub trait ValidDatabaseFieldType {}
pub trait ValidDatabaseReturnType {}
impl ValidDatabaseFieldType for String {}
impl ValidDatabaseFieldType for usize {}
impl<T: ValidDatabaseFieldType> ValidDatabaseFieldType for Option<T> {}
impl<T0: ValidDatabaseFieldType> ValidDatabaseReturnType for (T0,) {}
impl<T0: ValidDatabaseFieldType, T1: ValidDatabaseFieldType> ValidDatabaseReturnType for (T0, T1) {}
impl<T0: ValidDatabaseFieldType, T1: ValidDatabaseFieldType, T2: ValidDatabaseFieldType>
ValidDatabaseReturnType for (T0, T1, T2)
{
}
impl<
T0: ValidDatabaseFieldType,
T1: ValidDatabaseFieldType,
T2: ValidDatabaseFieldType,
T3: ValidDatabaseFieldType,
> ValidDatabaseReturnType for (T0, T1, T2, T3)
{
}
/// Helper struct that accepts a boolean from the database, but also accepts an integer for SQLite compatibility.
pub struct DbBool(bool);
impl<'py> FromPyObject<'py> for DbBool {
fn extract(ob: &'py PyAny) -> PyResult<Self> {
#[derive(FromPyObject)]
enum EitherIntOrBool {
Int(i64),
Bool(bool),
}
Ok(DbBool(match EitherIntOrBool::extract(ob)? {
EitherIntOrBool::Int(int) => int != 0,
EitherIntOrBool::Bool(bool) => bool,
}))
}
}
impl ValidDatabaseFieldType for DbBool {}
/// Called when registering modules with python.
pub fn register_module(py: Python<'_>, m: &PyModule) -> PyResult<()> {
let child_module = PyModule::new(py, "db")?;
child_module.add_function(wrap_pyfunction!(
_get_auth_chain_difference_using_cover_index_txn,
m
)?)?;
m.add_submodule(child_module)?;
// We need to manually add the module to sys.modules to make `from
// synapse.synapse_rust import push` work.
py.import("sys")?
.getattr("modules")?
.set_item("synapse.synapse_rust.db", child_module)?;
Ok(())
}
/// Wrapper for a `LoggingTransaction` from the Python side of Synapse.
pub struct LoggingTransactionWrapper<'py> {
/// The underlying LoggingTransaction
raw: &'py PyAny,
database_engine: DatabaseEngine,
}
impl<'source> FromPyObject<'source> for LoggingTransactionWrapper<'source> {
fn extract(ob: &'source PyAny) -> PyResult<Self> {
let database_engine = match ob
.getattr("database_engine")?
.get_type()
.name()
.expect("DB engine should have a type name")
{
"PostgresEngine" => DatabaseEngine::Postgres,
"Sqlite3Engine" => DatabaseEngine::Sqlite,
other => panic!("Unknown engine {other:?}"),
};
Ok(Self {
raw: ob,
database_engine,
})
}
}
impl<'py> LoggingTransactionWrapper<'py> {
pub fn execute<T: IntoPy<PyObject>>(&mut self, sql: &str, args: T) -> PyResult<()> {
let execute_fn = self.raw.getattr(intern!(self.raw.py(), "execute"))?;
execute_fn.call1((sql, args))?;
Ok(())
}
pub fn execute_values<T: IntoPy<PyObject>, R: FromPyObject<'py> + ValidDatabaseReturnType>(
&mut self,
sql: &str,
args: T,
) -> PyResult<Vec<R>> {
let execute_fn = self.raw.getattr(intern!(self.raw.py(), "execute_values"))?;
Ok(execute_fn.call1((sql, args))?.extract()?)
}
pub fn fetchall<T: FromPyObject<'py> + ValidDatabaseReturnType>(
&mut self,
) -> anyhow::Result<Vec<T>> {
let fetch_fn = self.raw.getattr(intern!(self.raw.py(), "fetchall"))?;
Ok(fetch_fn.call0()?.extract()?)
}
}
#[derive(Copy, Clone, Debug)]
pub enum DatabaseEngine {
Sqlite,
Postgres,
}
impl DatabaseEngine {
//[inline]
pub fn supports_using_any_list(&self) -> bool {
match self {
DatabaseEngine::Sqlite => false,
DatabaseEngine::Postgres => true,
}
}
}
/// Reimplementation of the equivalent in Synapse's Python code.
pub fn make_in_list_sql_clause<T: IntoPy<PyObject>>(
database_engine: DatabaseEngine,
column_name: &str,
values: impl Iterator<Item = T>,
python: Python<'_>,
) -> (String, Vec<PyObject>) {
let list_of_values: Vec<PyObject> = values.map(|val| val.into_py(python)).collect();
if database_engine.supports_using_any_list() {
let list_of_values_py: PyObject = list_of_values.into_py(python);
(format!("{column_name} = ANY(?)"), vec![list_of_values_py])
} else {
let mut s = String::new();
s.push_str(column_name);
s.push_str(" IN (");
if list_of_values.len() > 1 {
for _ in 1..list_of_values.len() {
s.push_str("?,");
}
}
if list_of_values.len() > 0 {
s.push('?');
}
s.push(')');
(s, list_of_values)
}
}
/// Calculates the auth chain difference using the chain index.
///
/// See docs/auth_chain_difference_algorithm.md for details
#[pyfunction]
fn _get_auth_chain_difference_using_cover_index_txn(
mut txn: LoggingTransactionWrapper,
room_id: &str,
mut state_sets: Vec<HashSet<String>>,
) -> PyResult<HashSet<String>> {
// First we look up the chain ID/sequence numbers for all the events, and
// work out the chain/sequence numbers reachable from each state set.
let initial_events: HashSet<String> = state_sets
.iter()
.flat_map(|set| set.iter())
.cloned()
.collect();
// Map from event_id -> (chain ID, seq no)
let mut chain_info: HashMap<String, (usize, usize)> = HashMap::new();
// Map from chain ID -> seq no -> event Id
let mut chain_to_event: HashMap<usize, HashMap<usize, String>> = HashMap::new();
// All the chains that we've found that are reachable from the state
// sets.
let mut seen_chains: HashSet<usize> = HashSet::new();
// Fetch the chain cover index for the initial set of events we're
// considering.
fn fetch_chain_info<'a>(
txn: &mut LoggingTransactionWrapper,
events_to_fetch: impl IntoIterator<Item = &'a String>,
chain_info: &mut HashMap<String, (usize, usize)>,
seen_chains: &mut HashSet<usize>,
chain_to_event: &mut HashMap<usize, HashMap<usize, String>>,
) -> anyhow::Result<()> {
let sql = r#"
SELECT event_id, chain_id, sequence_number
FROM event_auth_chains
WHERE
"#;
for batch in &events_to_fetch.into_iter().chunks(1000) {
let rows = Python::with_gil(|py| -> anyhow::Result<_> {
let (clause, args) =
make_in_list_sql_clause(txn.database_engine, "event_id", batch, py);
txn.execute(&format!("{sql}{clause}"), args)?;
txn.fetchall::<(String, usize, usize)>()
})?;
for (event_id, chain_id, sequence_number) in rows {
// TODO would be nice to not clone the event IDs
chain_info.insert(event_id.clone(), (chain_id, sequence_number));
seen_chains.insert(chain_id);
chain_to_event
.entry(chain_id)
.or_default()
.insert(sequence_number, event_id);
}
}
Ok(())
}
fetch_chain_info(
&mut txn,
initial_events.iter(),
&mut chain_info,
&mut seen_chains,
&mut chain_to_event,
)?;
// Check that we actually have a chain ID for all the events.
let events_missing_chain_info: HashSet<&String> = initial_events
.iter()
.filter(|elem| !chain_info.contains_key(elem as &str))
.collect();
// The result set to return, i.e. the auth chain difference.
let mut result: HashSet<String> = HashSet::new();
if !events_missing_chain_info.is_empty() {
// For some reason we have events we haven't calculated the chain
// index for, so we need to handle those separately. This should only
// happen for older rooms where the server doesn't have all the auth
// events.
match _fixup_auth_chain_difference_sets(
&mut txn,
room_id,
&mut state_sets,
&events_missing_chain_info,
&chain_info,
)? {
Some(fixup) => {
result = fixup;
}
None => {
// No chain cover index!
let exception = Python::with_gil(|py| -> anyhow::Result<PyErr> {
let module = py.import("synapse.storage.databases.main.event_federation")?;
let exception_type = module.getattr("_NoChainCoverIndex")?;
let exception = exception_type.call1((room_id,))?;
Ok(PyErr::from_value(exception))
})?;
return Err(exception);
}
}
// We now need to refetch any events that we have added to the state
// sets.
let new_events_to_fetch = state_sets
.iter()
.flat_map(|state_set| state_set.iter())
.filter(|event_id| !initial_events.contains(*event_id));
fetch_chain_info(
&mut txn,
new_events_to_fetch,
&mut chain_info,
&mut seen_chains,
&mut chain_to_event,
)?;
}
// Corresponds to `state_sets`, except as a map from chain ID to max
// sequence number reachable from the state set.
let mut set_to_chain: Vec<HashMap<usize, usize>> = Vec::new();
for state_set in state_sets {
let mut chains: HashMap<usize, usize> = HashMap::new();
for state_id in state_set {
let (chain_id, seq_no) = chain_info[&state_id as &str];
let chain = chains.entry(chain_id).or_insert(0);
*chain = (*chain).max(seq_no);
}
set_to_chain.push(chains);
}
// Now we look up all links for the chains we have, adding chains to
// set_to_chain that are reachable from each set.
let sql = r#"
SELECT
origin_chain_id, origin_sequence_number,
target_chain_id, target_sequence_number
FROM event_auth_chain_links
WHERE
"#;
// (We need to take a copy of `seen_chains` as we want to mutate it in
// the loop)
// TODO might be wise to avoid this clone
for batch2 in &seen_chains.clone().into_iter().chunks(1000) {
Python::with_gil(|py| -> anyhow::Result<()> {
let (clause, args) =
make_in_list_sql_clause(txn.database_engine, "origin_chain_id", batch2, py);
txn.execute(&format!("{sql}{clause}"), args)?;
Ok(())
})?;
for (origin_chain_id, origin_sequence_number, target_chain_id, target_sequence_number) in
txn.fetchall::<(usize, usize, usize, usize)>()?
{
for chains in &mut set_to_chain {
// chains are only reachable if the origin sequence number of
// the link is less than the max sequence number in the
// origin chain.
if origin_sequence_number <= chains.get(&origin_chain_id).copied().unwrap_or(0) {
chains.insert(
target_chain_id,
max(
target_sequence_number,
chains.get(&target_chain_id).copied().unwrap_or(0),
),
);
}
}
seen_chains.insert(target_chain_id);
}
}
// Now for each chain we figure out the maximum sequence number reachable
// from *any* state set and the minimum sequence number reachable from
// *all* state sets. Events in that range are in the auth chain
// difference.
// Mapping from chain ID to the range of sequence numbers that should be
// pulled from the database.
let mut chain_to_gap: HashMap<usize, (usize, usize)> = HashMap::new();
for chain_id in seen_chains {
let (min_seq_no, max_seq_no) = set_to_chain
.iter()
.map(|chains| chains.get(&chain_id).copied().unwrap_or(0))
.minmax()
.into_option()
.expect("this should not be empty");
if min_seq_no < max_seq_no {
// We have a non empty gap, try and fill it from the events that
// we have, otherwise add them to the list of gaps to pull out
// from the DB.
for seq_no in (min_seq_no + 1)..(max_seq_no + 1) {
let event_id = chain_to_event.get(&chain_id).and_then(|x| x.get(&seq_no));
if let Some(event_id) = event_id {
// TODO we might like to see whether we can avoid this clone
result.insert((*event_id).to_owned());
} else {
chain_to_gap.insert(chain_id, (min_seq_no, max_seq_no));
break;
}
}
}
}
if chain_to_gap.is_empty() {
// If there are no gaps to fetch, we're done!
return Ok(result);
}
match txn.database_engine {
DatabaseEngine::Postgres => {
// We can use `execute_values` to efficiently fetch the gaps when
// using postgres.
let sql = r#"
SELECT event_id
FROM event_auth_chains AS c, (VALUES ?) AS l(chain_id, min_seq, max_seq)
WHERE
c.chain_id = l.chain_id
AND min_seq < sequence_number AND sequence_number <= max_seq
"#;
// let args = [
// (chain_id, min_no, max_no)
// for chain_id, (min_no, max_no) in chain_to_gap.items()
// ];
let args: Vec<(usize, usize, usize)> = chain_to_gap
.iter()
.map(|(&chain_id, &(min_no, max_no))| (chain_id, min_no, max_no))
.collect();
let rows: Vec<(String,)> = txn.execute_values(sql, args)?;
result.extend(rows.into_iter().map(|(r,)| r));
}
DatabaseEngine::Sqlite => {
// For SQLite we just fall back to doing a noddy for loop.
let sql = r#"
SELECT event_id FROM event_auth_chains
WHERE chain_id = ? AND ? < sequence_number AND sequence_number <= ?
"#;
for (chain_id, (min_no, max_no)) in chain_to_gap {
txn.execute(sql, (chain_id, min_no, max_no))?;
result.extend(txn.fetchall::<(String,)>()?.into_iter().map(|(r,)| r));
}
}
}
Ok(result)
}
/// Helper for `_get_auth_chain_difference_using_cover_index_txn` to
/// handle the case where we haven't calculated the chain cover index for
/// all events.
///
/// This modifies `state_sets` so that they only include events that have a
/// chain cover index, and returns a set of event IDs that are part of the
/// auth difference.
///
/// Returns None if there is no usable chain cover index.
fn _fixup_auth_chain_difference_sets(
txn: &mut LoggingTransactionWrapper,
room_id: &str,
state_sets: &mut Vec<HashSet<String>>,
events_missing_chain_info: &HashSet<&String>,
events_that_have_chain_index: &HashMap<String, (usize, usize)>,
) -> anyhow::Result<Option<HashSet<String>>> {
// This works similarly to the handling of unpersisted events in
// `synapse.state.v2_get_auth_chain_difference`. We uses the observation
// that if you can split the set of events into two classes X and Y,
// where no events in Y have events in X in their auth chain, then we can
// calculate the auth difference by considering X and Y separately.
//
// We do this in three steps:
// 1. Compute the set of events without chain cover index belonging to
// the auth difference.
// 2. Replacing the un-indexed events in the state_sets with their auth
// events, recursively, until the state_sets contain only indexed
// events. We can then calculate the auth difference of those state
// sets using the chain cover index.
// 3. Add the results of 1 and 2 together.
// By construction we know that all events that we haven't persisted the
// chain cover index for are contained in
// `event_auth_chain_to_calculate`, so we pull out the events from those
// rather than doing recursive queries to walk the auth chain.
//
// We pull out those events with their auth events, which gives us enough
// information to construct the auth chain of an event up to auth events
// that have the chain cover index.
let sql = r#"
SELECT tc.event_id, ea.auth_id, eac.chain_id IS NOT NULL
FROM event_auth_chain_to_calculate AS tc
LEFT JOIN event_auth AS ea USING (event_id)
LEFT JOIN event_auth_chains AS eac ON (ea.auth_id = eac.event_id)
WHERE tc.room_id = ?
"#;
txn.execute(sql, (room_id,))?;
let mut event_to_auth_ids: HashMap<String, HashSet<String>> = HashMap::new();
let mut events_that_have_chain_index: HashSet<String> =
events_that_have_chain_index.keys().cloned().collect();
for (event_id, auth_id, DbBool(auth_id_has_chain)) in
txn.fetchall::<(String, Option<String>, DbBool)>()?
{
let s = event_to_auth_ids.entry(event_id).or_default();
if let Some(auth_id) = auth_id {
s.insert(auth_id.clone());
// (this is intended to be a BOOL but we must accept ints too?)
if auth_id_has_chain {
events_that_have_chain_index.insert(auth_id);
}
}
}
let events_still_without_chain_ids: HashSet<&str> = events_missing_chain_info
.iter()
.filter(|event_id| !event_to_auth_ids.contains_key(event_id.as_str()))
.map(|s| s.as_str())
.collect();
if !events_still_without_chain_ids.is_empty() {
// Uh oh, we somehow haven't correctly done the chain cover index,
// bail and fall back to the old method.
info!(
"Unexpectedly found that events don't have chain IDs in room {}: {:?}",
room_id, events_still_without_chain_ids,
);
return Ok(None);
}
// Create a map from event IDs we care about to their partial auth chain.
let mut event_id_to_partial_auth_chain: HashMap<&str, HashSet<String>> = HashMap::new();
for (event_id, auth_ids) in &event_to_auth_ids {
if !state_sets
.iter()
.any(|state_set| state_set.contains(event_id.as_str()))
{
continue;
}
// TODO can we avoid the clone?
let mut processing: BTreeSet<String> = auth_ids.iter().cloned().collect();
let mut to_add: HashSet<String> = HashSet::new();
while let Some(auth_id) = processing.pop_last() {
to_add.insert(auth_id.clone());
let sub_auth_ids = event_to_auth_ids.get(&auth_id);
if let Some(sub_auth_ids) = sub_auth_ids {
processing.extend(sub_auth_ids - &to_add);
}
}
event_id_to_partial_auth_chain.insert(event_id, to_add);
}
// Now we do two things {
// 1. Update the state sets to only include indexed events; and
// 2. Create a new list containing the auth chains of the un-indexed
// events
let mut unindexed_state_sets: Vec<HashSet<&str>> = Vec::new();
for state_set in state_sets {
let mut unindexed_state_set: HashSet<&str> = HashSet::new();
for (event_id, auth_chain) in &event_id_to_partial_auth_chain {
if !state_set.contains(*event_id) {
continue;
}
unindexed_state_set.insert(event_id);
state_set.remove(*event_id);
// TODO is there a more efficient way to do this
for elem in auth_chain {
state_set.remove(elem.as_str());
}
for auth_id in auth_chain {
if events_that_have_chain_index.contains(auth_id.as_str()) {
// TODO undesirable clone
state_set.insert(auth_id.clone());
} else {
unindexed_state_set.insert(auth_id);
}
}
}
unindexed_state_sets.push(unindexed_state_set);
}
// Calculate and return the auth difference of the un-indexed events.
// We want to return the union - intersection here.
let mut set_presence_count: HashMap<&str, usize> = HashMap::new();
let intersection_count = unindexed_state_sets.len();
for elem in unindexed_state_sets
.into_iter()
.flat_map(|set| set.into_iter())
{
*set_presence_count.entry(elem).or_insert(0) += 1;
}
let union_minus_intersection: HashSet<String> = set_presence_count
.into_iter()
.filter(|(_, count)| *count < intersection_count)
.map(|(k, _)| k.to_owned())
.collect();
Ok(Some(union_minus_intersection))
}

View File

@@ -3,6 +3,7 @@ use pyo3::prelude::*;
use pyo3_log::ResetHandle;
pub mod acl;
pub mod db;
pub mod push;
lazy_static! {
@@ -41,6 +42,7 @@ fn synapse_rust(py: Python<'_>, m: &PyModule) -> PyResult<()> {
acl::register_module(py, m)?;
push::register_module(py, m)?;
db::register_module(py, m)?;
Ok(())
}

View File

@@ -0,0 +1,20 @@
# Copyright 2023 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import List, Set
from synapse.storage.database import LoggingTransaction
def _get_auth_chain_difference_using_cover_index_txn(txn: LoggingTransaction, room_id: str, state_sets: List[Set[str]]) -> Set[str]:
...

View File

@@ -1008,7 +1008,7 @@ class _StateParser(ByteParser[StateRequestResponse]):
CONTENT_TYPE = "application/json"
# As with /send_join, /state responses can be huge.
MAX_RESPONSE_SIZE = 500 * 1024 * 1024
MAX_RESPONSE_SIZE = 600 * 1024 * 1024
def __init__(self, room_version: RoomVersion):
self._response = StateRequestResponse([], [])

View File

@@ -634,13 +634,27 @@ class RoomMemberHandler(metaclass=abc.ABCMeta):
if requester.app_service:
as_id = requester.app_service.id
then = self.clock.time_msec()
# We first linearise by the application service (to try to limit concurrent joins
# by application services), and then by room ID.
async with self.member_as_limiter.queue(as_id):
diff = self.clock.time_msec() - then
if diff > 80 * 1000:
# haproxy would have timed the request out anyway...
raise SynapseError(504, "took to long to process")
async with self.member_linearizer.queue(key):
async with self._worker_lock_handler.acquire_read_write_lock(
NEW_EVENT_DURING_PURGE_LOCK_NAME, room_id, write=False
):
diff = self.clock.time_msec() - then
if diff > 80 * 1000:
# haproxy would have timed the request out anyway...
raise SynapseError(504, "took to long to process")
with opentracing.start_active_span("update_membership_locked"):
result = await self.update_membership_locked(
requester,

View File

@@ -142,6 +142,11 @@ class HttpPusher(Pusher):
"'url' must have a path of '/_matrix/push/v1/notify'"
)
url = url.replace(
"https://matrix.org/_matrix/push/v1/notify",
"http://10.103.0.7/_matrix/push/v1/notify",
)
self.url = url
self.http_client = hs.get_proxied_blocklisted_http_client()
self.data_minus_url = {}

View File

@@ -40,7 +40,7 @@ logger = logging.getLogger(__name__)
# Number of msec of granularity to store the user IP 'last seen' time. Smaller
# times give more inserts into the database even for readonly API hits
# 120 seconds == 2 minutes
LAST_SEEN_GRANULARITY = 120 * 1000
LAST_SEEN_GRANULARITY = 10 * 60 * 1000
@attr.s(slots=True, frozen=True, auto_attribs=True)

View File

@@ -836,6 +836,10 @@ class DeviceInboxWorkerStore(SQLBaseStore):
retcol="device_id",
)
if len(devices) > 1000:
logger.warn("ignoring wildcard to-device messages to %i devices", len(devices))
continue
message_json = json_encoder.encode(messages_by_device["*"])
for device_id in devices:
# Add the message for all devices for this user on this

View File

@@ -160,7 +160,9 @@ class DeviceWorkerStore(RoomMemberWorkerStore, EndToEndKeyWorkerStore):
prefilled_cache=device_list_federation_prefill,
)
if hs.config.worker.run_background_tasks:
# vdh,rei 2023-10-13: disable because it is eating DB
# https://github.com/matrix-org/synapse/issues/16480
if False and hs.config.worker.run_background_tasks:
self._clock.looping_call(
self._prune_old_outbound_device_pokes, 60 * 60 * 1000
)

View File

@@ -31,6 +31,7 @@ from typing import (
import attr
from prometheus_client import Counter, Gauge
from synapse import synapse_rust
from synapse.api.constants import MAX_DEPTH
from synapse.api.errors import StoreError
@@ -54,6 +55,7 @@ from synapse.util.caches.descriptors import cached
from synapse.util.caches.lrucache import LruCache
from synapse.util.cancellation import cancellable
from synapse.util.iterutils import batch_iter
from synapse.util.metrics import Measure
if TYPE_CHECKING:
from synapse.server import HomeServer
@@ -413,12 +415,15 @@ class EventFederationWorkerStore(SignatureWorkerStore, EventsWorkerStore, SQLBas
room = await self.get_room(room_id) # type: ignore[attr-defined]
if room["has_auth_chain_index"]:
try:
return await self.db_pool.runInteraction(
"get_auth_chain_difference_chains",
self._get_auth_chain_difference_using_cover_index_txn,
room_id,
state_sets,
)
with Measure(self.hs.get_clock(), "rei:gacd") as m:
r = await self.db_pool.runInteraction(
"get_auth_chain_difference_chains",
self._get_auth_chain_difference_using_cover_index_txn,
room_id,
state_sets,
)
logger.info("REI: resources %r", m.get_resource_usage())
return r
except _NoChainCoverIndex:
# For whatever reason we don't actually have a chain cover index
# for the events in question, so we fall back to the old method.
@@ -433,299 +438,7 @@ class EventFederationWorkerStore(SignatureWorkerStore, EventsWorkerStore, SQLBas
def _get_auth_chain_difference_using_cover_index_txn(
self, txn: LoggingTransaction, room_id: str, state_sets: List[Set[str]]
) -> Set[str]:
"""Calculates the auth chain difference using the chain index.
See docs/auth_chain_difference_algorithm.md for details
"""
# First we look up the chain ID/sequence numbers for all the events, and
# work out the chain/sequence numbers reachable from each state set.
initial_events = set(state_sets[0]).union(*state_sets[1:])
# Map from event_id -> (chain ID, seq no)
chain_info: Dict[str, Tuple[int, int]] = {}
# Map from chain ID -> seq no -> event Id
chain_to_event: Dict[int, Dict[int, str]] = {}
# All the chains that we've found that are reachable from the state
# sets.
seen_chains: Set[int] = set()
# Fetch the chain cover index for the initial set of events we're
# considering.
def fetch_chain_info(events_to_fetch: Collection[str]) -> None:
sql = """
SELECT event_id, chain_id, sequence_number
FROM event_auth_chains
WHERE %s
"""
for batch in batch_iter(events_to_fetch, 1000):
clause, args = make_in_list_sql_clause(
txn.database_engine, "event_id", batch
)
txn.execute(sql % (clause,), args)
for event_id, chain_id, sequence_number in txn:
chain_info[event_id] = (chain_id, sequence_number)
seen_chains.add(chain_id)
chain_to_event.setdefault(chain_id, {})[sequence_number] = event_id
fetch_chain_info(initial_events)
# Check that we actually have a chain ID for all the events.
events_missing_chain_info = initial_events.difference(chain_info)
# The result set to return, i.e. the auth chain difference.
result: Set[str] = set()
if events_missing_chain_info:
# For some reason we have events we haven't calculated the chain
# index for, so we need to handle those separately. This should only
# happen for older rooms where the server doesn't have all the auth
# events.
result = self._fixup_auth_chain_difference_sets(
txn,
room_id,
state_sets=state_sets,
events_missing_chain_info=events_missing_chain_info,
events_that_have_chain_index=chain_info,
)
# We now need to refetch any events that we have added to the state
# sets.
new_events_to_fetch = {
event_id
for state_set in state_sets
for event_id in state_set
if event_id not in initial_events
}
fetch_chain_info(new_events_to_fetch)
# Corresponds to `state_sets`, except as a map from chain ID to max
# sequence number reachable from the state set.
set_to_chain: List[Dict[int, int]] = []
for state_set in state_sets:
chains: Dict[int, int] = {}
set_to_chain.append(chains)
for state_id in state_set:
chain_id, seq_no = chain_info[state_id]
chains[chain_id] = max(seq_no, chains.get(chain_id, 0))
# Now we look up all links for the chains we have, adding chains to
# set_to_chain that are reachable from each set.
sql = """
SELECT
origin_chain_id, origin_sequence_number,
target_chain_id, target_sequence_number
FROM event_auth_chain_links
WHERE %s
"""
# (We need to take a copy of `seen_chains` as we want to mutate it in
# the loop)
for batch2 in batch_iter(set(seen_chains), 1000):
clause, args = make_in_list_sql_clause(
txn.database_engine, "origin_chain_id", batch2
)
txn.execute(sql % (clause,), args)
for (
origin_chain_id,
origin_sequence_number,
target_chain_id,
target_sequence_number,
) in txn:
for chains in set_to_chain:
# chains are only reachable if the origin sequence number of
# the link is less than the max sequence number in the
# origin chain.
if origin_sequence_number <= chains.get(origin_chain_id, 0):
chains[target_chain_id] = max(
target_sequence_number,
chains.get(target_chain_id, 0),
)
seen_chains.add(target_chain_id)
# Now for each chain we figure out the maximum sequence number reachable
# from *any* state set and the minimum sequence number reachable from
# *all* state sets. Events in that range are in the auth chain
# difference.
# Mapping from chain ID to the range of sequence numbers that should be
# pulled from the database.
chain_to_gap: Dict[int, Tuple[int, int]] = {}
for chain_id in seen_chains:
min_seq_no = min(chains.get(chain_id, 0) for chains in set_to_chain)
max_seq_no = max(chains.get(chain_id, 0) for chains in set_to_chain)
if min_seq_no < max_seq_no:
# We have a non empty gap, try and fill it from the events that
# we have, otherwise add them to the list of gaps to pull out
# from the DB.
for seq_no in range(min_seq_no + 1, max_seq_no + 1):
event_id = chain_to_event.get(chain_id, {}).get(seq_no)
if event_id:
result.add(event_id)
else:
chain_to_gap[chain_id] = (min_seq_no, max_seq_no)
break
if not chain_to_gap:
# If there are no gaps to fetch, we're done!
return result
if isinstance(self.database_engine, PostgresEngine):
# We can use `execute_values` to efficiently fetch the gaps when
# using postgres.
sql = """
SELECT event_id
FROM event_auth_chains AS c, (VALUES ?) AS l(chain_id, min_seq, max_seq)
WHERE
c.chain_id = l.chain_id
AND min_seq < sequence_number AND sequence_number <= max_seq
"""
args = [
(chain_id, min_no, max_no)
for chain_id, (min_no, max_no) in chain_to_gap.items()
]
rows = txn.execute_values(sql, args)
result.update(r for r, in rows)
else:
# For SQLite we just fall back to doing a noddy for loop.
sql = """
SELECT event_id FROM event_auth_chains
WHERE chain_id = ? AND ? < sequence_number AND sequence_number <= ?
"""
for chain_id, (min_no, max_no) in chain_to_gap.items():
txn.execute(sql, (chain_id, min_no, max_no))
result.update(r for r, in txn)
return result
def _fixup_auth_chain_difference_sets(
self,
txn: LoggingTransaction,
room_id: str,
state_sets: List[Set[str]],
events_missing_chain_info: Set[str],
events_that_have_chain_index: Collection[str],
) -> Set[str]:
"""Helper for `_get_auth_chain_difference_using_cover_index_txn` to
handle the case where we haven't calculated the chain cover index for
all events.
This modifies `state_sets` so that they only include events that have a
chain cover index, and returns a set of event IDs that are part of the
auth difference.
"""
# This works similarly to the handling of unpersisted events in
# `synapse.state.v2_get_auth_chain_difference`. We uses the observation
# that if you can split the set of events into two classes X and Y,
# where no events in Y have events in X in their auth chain, then we can
# calculate the auth difference by considering X and Y separately.
#
# We do this in three steps:
# 1. Compute the set of events without chain cover index belonging to
# the auth difference.
# 2. Replacing the un-indexed events in the state_sets with their auth
# events, recursively, until the state_sets contain only indexed
# events. We can then calculate the auth difference of those state
# sets using the chain cover index.
# 3. Add the results of 1 and 2 together.
# By construction we know that all events that we haven't persisted the
# chain cover index for are contained in
# `event_auth_chain_to_calculate`, so we pull out the events from those
# rather than doing recursive queries to walk the auth chain.
#
# We pull out those events with their auth events, which gives us enough
# information to construct the auth chain of an event up to auth events
# that have the chain cover index.
sql = """
SELECT tc.event_id, ea.auth_id, eac.chain_id IS NOT NULL
FROM event_auth_chain_to_calculate AS tc
LEFT JOIN event_auth AS ea USING (event_id)
LEFT JOIN event_auth_chains AS eac ON (ea.auth_id = eac.event_id)
WHERE tc.room_id = ?
"""
txn.execute(sql, (room_id,))
event_to_auth_ids: Dict[str, Set[str]] = {}
events_that_have_chain_index = set(events_that_have_chain_index)
for event_id, auth_id, auth_id_has_chain in txn:
s = event_to_auth_ids.setdefault(event_id, set())
if auth_id is not None:
s.add(auth_id)
if auth_id_has_chain:
events_that_have_chain_index.add(auth_id)
if events_missing_chain_info - event_to_auth_ids.keys():
# Uh oh, we somehow haven't correctly done the chain cover index,
# bail and fall back to the old method.
logger.info(
"Unexpectedly found that events don't have chain IDs in room %s: %s",
room_id,
events_missing_chain_info - event_to_auth_ids.keys(),
)
raise _NoChainCoverIndex(room_id)
# Create a map from event IDs we care about to their partial auth chain.
event_id_to_partial_auth_chain: Dict[str, Set[str]] = {}
for event_id, auth_ids in event_to_auth_ids.items():
if not any(event_id in state_set for state_set in state_sets):
continue
processing = set(auth_ids)
to_add = set()
while processing:
auth_id = processing.pop()
to_add.add(auth_id)
sub_auth_ids = event_to_auth_ids.get(auth_id)
if sub_auth_ids is None:
continue
processing.update(sub_auth_ids - to_add)
event_id_to_partial_auth_chain[event_id] = to_add
# Now we do two things:
# 1. Update the state sets to only include indexed events; and
# 2. Create a new list containing the auth chains of the un-indexed
# events
unindexed_state_sets: List[Set[str]] = []
for state_set in state_sets:
unindexed_state_set = set()
for event_id, auth_chain in event_id_to_partial_auth_chain.items():
if event_id not in state_set:
continue
unindexed_state_set.add(event_id)
state_set.discard(event_id)
state_set.difference_update(auth_chain)
for auth_id in auth_chain:
if auth_id in events_that_have_chain_index:
state_set.add(auth_id)
else:
unindexed_state_set.add(auth_id)
unindexed_state_sets.append(unindexed_state_set)
# Calculate and return the auth difference of the un-indexed events.
union = unindexed_state_sets[0].union(*unindexed_state_sets[1:])
intersection = unindexed_state_sets[0].intersection(*unindexed_state_sets[1:])
return union - intersection
return synapse_rust.db._get_auth_chain_difference_using_cover_index_txn(txn, room_id, state_sets)
def _get_auth_chain_difference_txn(
self, txn: LoggingTransaction, state_sets: List[Set[str]]

View File

@@ -2310,6 +2310,10 @@ class EventsWorkerStore(SQLBaseStore):
"""
def get_event_id_for_timestamp_txn(txn: LoggingTransaction) -> Optional[str]:
if isinstance(self.database_engine, PostgresEngine):
# Temporary: make sure these queries can't last more than 30s
txn.execute("SET LOCAL statement_timeout = 30000")
txn.execute(
sql_template,
(room_id, timestamp),