1
0

Compare commits

...

150 Commits

Author SHA1 Message Date
Matthew Hodgson aa70b0afb1 fix pep8 2018-01-09 20:37:12 +00:00
Matthew Hodgson 12545a80e7 fix presence tests 2018-01-09 19:47:53 +00:00
Matthew Hodgson d0ffa56271 don't apply the ratelimiter for noop AS member changes 2018-01-09 19:31:04 +00:00
hera 00c7472624 oops 2018-01-09 18:06:30 +00:00
Matthew Hodgson c16e9a6cf8 oops, tweak work_mem when actually storing 2018-01-09 17:52:36 +00:00
Matthew Hodgson 2cb082352b avoid 80s GIN inserts by tweaking work_mem
see https://github.com/matrix-org/synapse/issues/2753 for details
2018-01-09 17:52:36 +00:00
Erik Johnston 2388c77439 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-12-04 13:46:06 +00:00
Richard van der Hoff ac73960887 Merge pull request #2714 from matrix-org/rav/revert_mxid_case_thing
Revert "Allow upper-case characters in mxids"
2017-11-27 18:10:53 +00:00
Richard van der Hoff 39b9c83a38 Revert "Allow upper-case characters in mxids"
This has already been reverted on develop and replaced with a better
implementation (see PR #2662), but because the 'allow upper-case characters'
commit got separately applied to both develop and matrix-org-hotfixes, it
hasn't been correctly reverted on matrix-org-hotfixes.
2017-11-27 15:04:49 +00:00
Erik Johnston 6c9d1e882d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-11-27 14:20:13 +00:00
Richard van der Hoff 4f886a2356 Merge pull request #2709 from matrix-org/rav/disable_presence_better
Avoid doing presence updates on replication reconnect
2017-11-27 12:16:13 +00:00
Richard van der Hoff ae74b2db99 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.
2017-11-24 00:38:44 +00:00
Erik Johnston 7add114dc3 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-11-13 10:23:38 +00:00
Erik Johnston 20c07df5ce Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-11-13 09:54:53 +00:00
Richard van der Hoff f18226762b Allow upper-case characters in mxids
Because we're never going to be able to fix this :'(
2017-11-09 20:07:36 +00:00
Richard van der Hoff 4dccdde928 Merge branch 'develop' into matrix-org-hotfixes 2017-10-30 10:11:42 +00:00
Richard van der Hoff cd0a800c5a Merge pull request #2587 from matrix-org/rav/frontend_proxy_auth_header_matrix_hotfixes
Front-end proxy: fix auth header for presence too
2017-10-27 12:57:11 +01:00
Richard van der Hoff d55f680f60 Merge branch 'matrix-org-hotfixes' into rav/frontend_proxy_auth_header_matrix_hotfixes 2017-10-27 12:39:45 +01:00
Richard van der Hoff 52ac6571d4 PEP8
fix except clause and indentation
2017-10-27 12:37:48 +01:00
Richard van der Hoff 767ff59578 fix trailing whitespace 2017-10-27 12:36:58 +01:00
Richard van der Hoff 6995d82cc9 Merge branch 'matrix-org-hotfixes' into rav/frontend_proxy_auth_header_matrix_hotfixes 2017-10-27 11:07:44 +01:00
Richard van der Hoff 1435d78d0d Merge branch 'develop' into matrix-org-hotfixes 2017-10-27 11:07:33 +01:00
Richard van der Hoff 2ba1922bfe Front-end proxy: fix auth header for presence too 2017-10-26 22:13:26 +01:00
Erik Johnston 8bcbeeaaba Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-10-19 15:10:11 +01:00
Erik Johnston d747db1357 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-10-19 11:23:05 +01:00
Erik Johnston 16d8f4eae2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-10-19 10:57:15 +01:00
hera 8287457da5 log when we get an exception handling replication updates 2017-10-12 10:50:44 +00:00
hera eccc9b940a Disable auth on room_members for now
because the moznet bridge is broken (https://github.com/matrix-org/matrix-appservice-irc/issues/506)
2017-10-12 10:41:46 +00:00
Richard van der Hoff d374345782 Merge branch 'develop' into matrix-org-hotfixes 2017-10-12 11:21:35 +01:00
Erik Johnston 33f541583b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-10-11 16:08:56 +01:00
Erik Johnston 507365c0d9 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-10-11 14:33:15 +01:00
Erik Johnston 5b75fbe6fe Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-10-11 13:23:50 +01:00
Richard van der Hoff 3af802e096 Merge branch 'rav/fancy_logformatter' into matrix-org-hotfixes 2017-10-10 09:38:53 +01:00
Richard van der Hoff fdf4e8fb2b Merge branch 'develop' into matrix-org-hotfixes 2017-10-10 09:37:07 +01:00
Erik Johnston f2ac223dcd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-09-28 14:27:43 +01:00
Erik Johnston febd78d700 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-09-28 14:00:22 +01:00
hera e0ddf0a249 Disable presence some more 2017-09-28 08:45:43 +00:00
Erik Johnston cb51361a35 Actually block presence 2017-09-25 18:07:47 +01:00
Erik Johnston 0a34b7675f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-09-25 17:43:26 +01:00
Erik Johnston 85b7791b42 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-09-25 14:17:30 +01:00
Richard van der Hoff 88185fe69f Merge branch 'develop' into matrix-org-hotfixes 2017-08-16 15:13:28 +01:00
Richard van der Hoff cb7b5f62bc Merge branch 'develop' into matrix-org-hotfixes 2017-08-16 15:01:41 +01:00
Richard van der Hoff 42b6461dcf Merge branch 'develop' into matrix-org-hotfixes 2017-08-16 14:31:31 +01:00
hera 2d2f12f2e5 fix english 2017-08-04 22:56:12 +00:00
hera ce408ca011 typo 2017-08-04 22:44:11 +00:00
Erik Johnston aa587095f8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-07-17 09:42:45 +01:00
Erik Johnston 580e4ceb13 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-07-14 15:25:55 +01:00
Erik Johnston a2200097e1 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-07-12 10:45:46 +01:00
Erik Johnston e40bb80f5c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-07-11 10:53:41 +01:00
hera f2db3e4856 Random stuff 2017-07-07 17:59:56 +00:00
Erik Johnston 715bcf7448 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-07-07 18:37:24 +01:00
Erik Johnston 08e0e868af Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-07-07 18:26:12 +01:00
Erik Johnston e08bf646aa Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-07-07 14:25:58 +01:00
Erik Johnston 90155899b0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-30 11:03:33 +01:00
Erik Johnston eaab0d744c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-29 15:07:01 +01:00
Erik Johnston 8c1c1076f0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-29 14:20:34 +01:00
Erik Johnston 1a8bfe6539 Merge branch 'erikj/user_ip_repl' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-27 15:54:51 +01:00
Erik Johnston 4717954b1f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-27 15:41:54 +01:00
Erik Johnston 9b4fafbc8b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-23 14:03:05 +01:00
Erik Johnston 34fc293dc5 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-22 15:15:17 +01:00
Erik Johnston 3584db19cb Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-21 14:55:28 +01:00
Erik Johnston 41af55b890 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-19 18:16:47 +01:00
Erik Johnston 370bfa2ff0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-16 13:02:24 +01:00
Erik Johnston 9a4bba9d08 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-13 12:50:59 +01:00
Erik Johnston cefe8bcff0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-13 11:38:58 +01:00
hera 84ecb8f2e7 Reenable user dir 2017-06-13 10:01:18 +00:00
Erik Johnston bda356162a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-13 10:59:52 +01:00
Erik Johnston 0127ea611b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-12 13:13:49 +01:00
Erik Johnston 27a5ae2bca Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-08 13:09:58 +01:00
hera fc51c7d833 hot fixes 2017-06-08 00:34:47 +00:00
Erik Johnston 93ff41e845 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-07 17:51:35 +01:00
Erik Johnston 2cd74ed38a Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-07 14:05:07 +01:00
Erik Johnston 6cc26df2fa Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-06 11:50:35 +01:00
Erik Johnston e73191fffc Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-06 11:47:01 +01:00
Erik Johnston 20e5490ddd Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-06-06 11:36:16 +01:00
Erik Johnston 336a5ae1f4 Limit concurrent AS joins 2017-05-23 10:48:13 +01:00
Erik Johnston 59159ed81d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-22 16:56:24 +01:00
Erik Johnston f0ed2e408f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-19 14:50:55 +01:00
Erik Johnston 3da426357c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-19 13:43:01 +01:00
Erik Johnston 5b83e958e8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-18 17:48:53 +01:00
Erik Johnston 0e242aebc0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-18 17:18:10 +01:00
Erik Johnston e8ac65c4c9 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-18 16:51:40 +01:00
Erik Johnston fbec8847be Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-18 16:04:59 +01:00
Erik Johnston 689b454674 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-18 10:03:21 +01:00
Erik Johnston 120eefdc19 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-15 11:36:34 +01:00
Erik Johnston b517ae2d03 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-11 09:04:03 +01:00
Erik Johnston ce32d1eed2 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-09 09:58:20 +01:00
Erik Johnston 0d8a2ee02b Revert "Remove unused import"
This reverts commit ab37bef83b.
2017-05-05 11:23:33 +01:00
Erik Johnston 25d3f28a98 Revert "We don't care about forgotten rooms"
This reverts commit ad8b316939.
2017-05-05 11:23:33 +01:00
Erik Johnston 17ddec014a Revert "Speed up filtering of a single event in push"
This reverts commit 421fdf7460.
2017-05-05 11:23:32 +01:00
Erik Johnston fb4c0ada1f Disable presence
This reverts commit 0ebd376a53 and
disables presence a bit more
2017-05-05 11:03:37 +01:00
Erik Johnston 85999aade0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-05 11:00:45 +01:00
Erik Johnston dfc7bf2e84 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-03 10:54:24 +01:00
Erik Johnston 02928332d5 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-05-03 09:49:25 +01:00
hera 0ebd376a53 Reenable presence 2017-05-03 08:48:47 +00:00
Erik Johnston 05e62e0478 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-26 14:03:15 +01:00
Erik Johnston 97359ca4ec Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-25 11:18:47 +01:00
Erik Johnston 037aede1ee Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-24 14:36:14 +01:00
Erik Johnston 7ceacaaa6e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-12 13:59:50 +01:00
Erik Johnston 0cbdfcbb75 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-11 09:44:37 +01:00
Erik Johnston 088d52ba6c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-10 14:44:05 +01:00
Erik Johnston d728648b65 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-05 14:24:41 +01:00
Erik Johnston 023600d20c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-05 10:10:07 +01:00
Erik Johnston 076bc0510b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-04 15:47:19 +01:00
Erik Johnston 2effa32140 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-04-04 11:20:46 +01:00
Erik Johnston d7dbc56c71 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-31 10:11:07 +01:00
Erik Johnston 1ec9f7db27 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-27 18:39:25 +01:00
Erik Johnston 8224121502 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-24 13:59:35 +00:00
Erik Johnston c042bcbe0f Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-21 13:11:19 +00:00
Erik Johnston 5bf6bcb850 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-21 13:09:38 +00:00
Erik Johnston bbc0dbeec0 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-16 13:05:27 +00:00
Erik Johnston b6b1382be1 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-15 16:08:46 +00:00
Erik Johnston 224dc4f6a9 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-15 11:30:41 +00:00
Erik Johnston f90eb60ae9 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-15 10:00:10 +00:00
Erik Johnston a0d6987991 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-13 10:06:28 +00:00
Erik Johnston bf575ae20e Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-09 10:40:54 +00:00
Erik Johnston 929b005999 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-03-09 10:40:47 +00:00
Erik Johnston 01bcf01927 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-28 16:22:54 +00:00
Erik Johnston ec9c8fc6cf Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-28 15:21:35 +00:00
Erik Johnston f2c9e51d28 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-28 14:11:07 +00:00
Erik Johnston 8a6196c6c8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-27 16:40:11 +00:00
Matrix 8d910ff5b9 Local changes 2017-02-24 16:01:57 +00:00
Erik Johnston cff886c47b Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-21 14:01:45 +00:00
Erik Johnston a24492c06f Don't limit count 2017-02-21 14:01:33 +00:00
Erik Johnston ede125b7e1 Fix up notif rotation 2017-02-18 14:41:31 +00:00
Erik Johnston c97d491649 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-16 15:12:52 +00:00
Erik Johnston 3b42bb96e4 Merge commit 'd7457c7661fa3b28427b21f44252c3abbee45ef8' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-15 10:17:01 +00:00
Erik Johnston 738000971e Merge branch 'develop' into matrix-org-hotfixes 2017-02-15 09:54:09 +00:00
Erik Johnston 96ef35c62f Merge branch 'master' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-09 13:50:38 +00:00
Erik Johnston 83c7b8ec91 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-02 19:26:05 +00:00
Erik Johnston f57cb21952 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-02 09:30:20 +00:00
Erik Johnston 4abecb7b02 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-02-01 14:33:28 +00:00
Erik Johnston 010159365c Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-01-31 11:20:51 +00:00
Erik Johnston 717e4448c4 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-01-30 14:36:46 +00:00
Erik Johnston e41f183aa8 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-01-20 14:00:31 +00:00
Erik Johnston 10f7bfe897 Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-01-11 10:57:42 +00:00
Erik Johnston 772b8ebe54 PEP8 2017-01-10 16:38:00 +00:00
Erik Johnston 3c9acdef4d Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-01-10 16:31:06 +00:00
Erik Johnston fe28150cdc Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes 2017-01-10 16:16:17 +00:00
Mark Haines 69ef497253 Log which files we saved attachments to in the media_repository 2017-01-10 14:29:17 +00:00
Matrix 1d08de6ce9 Merge branch 'release-v0.18.7' into matrix-org-hotfixes 2017-01-07 04:03:15 +00:00
Matrix 10d31c433b Merge branch 'release-v0.18.7' into matrix-org-hotfixes 2017-01-07 03:12:35 +00:00
Mark Haines 345afd9fdc Merge tag 'v0.18.6-rc3' into matrix-org-hotfixes
v0.18.6-rc3
2017-01-05 14:19:36 +00:00
Matrix 7ed07066ac Merge branch 'markjh/linearizer_logging' into matrix-org-hotfixes 2017-01-01 13:55:13 +00:00
Mark Haines 2f703b8645 Merge branch 'markjh/fix_get_missing' into matrix-org-hotfixes 2016-12-30 18:47:10 +00:00
Mark Haines 9fff1aacca Merge remote-tracking branch 'origin/release-v0.18.6' into matrix-org-hotfixes 2016-12-30 14:04:16 +00:00
Mark Haines cb842dc99f Deleting from event_push_actions needs to use an index 2016-12-29 16:54:03 +00:00
Mark Haines 2238a10b42 Merge branch 'release-v0.18.6' into matrix-org-hotfixes 2016-12-29 16:26:52 +00:00
Matthew Hodgson 2998fa57b0 merge uncommitted changes from matrix.org into hotfixes-v0.18.5 2016-12-20 12:14:08 +00:00
Richard van der Hoff f5abaafabd uncommitted changes on matrix.org
These might be important? who knows?
2016-12-20 11:49:25 +00:00
23 changed files with 183 additions and 117 deletions
+31
View File
@@ -36,6 +36,7 @@ from synapse.replication.slave.storage.client_ips import SlavedClientIpStore
from synapse.replication.slave.storage.devices import SlavedDeviceStore
from synapse.replication.slave.storage.registration import SlavedRegistrationStore
from synapse.replication.tcp.client import ReplicationClientHandler
from synapse.rest.client.v1.base import ClientV1RestServlet, client_path_patterns
from synapse.rest.client.v2_alpha._base import client_v2_patterns
from synapse.server import HomeServer
from synapse.storage.engines import create_engine
@@ -49,6 +50,35 @@ from twisted.web.resource import Resource
logger = logging.getLogger("synapse.app.frontend_proxy")
class PresenceStatusStubServlet(ClientV1RestServlet):
PATTERNS = client_path_patterns("/presence/(?P<user_id>[^/]*)/status")
def __init__(self, hs):
super(PresenceStatusStubServlet, self).__init__(hs)
self.http_client = hs.get_simple_http_client()
self.auth = hs.get_auth()
self.main_uri = hs.config.worker_main_http_uri
@defer.inlineCallbacks
def on_GET(self, request, user_id):
# Pass through the auth headers, if any, in case the access token
# is there.
auth_headers = request.requestHeaders.getRawHeaders("Authorization", [])
headers = {
"Authorization": auth_headers,
}
result = yield self.http_client.get_json(
self.main_uri + request.uri,
headers=headers,
)
defer.returnValue((200, result))
@defer.inlineCallbacks
def on_PUT(self, request, user_id):
yield self.auth.get_user_by_req(request)
defer.returnValue((200, {}))
class KeyUploadServlet(RestServlet):
PATTERNS = client_v2_patterns("/keys/upload(/(?P<device_id>[^/]+))?$")
@@ -148,6 +178,7 @@ class FrontendProxyServer(HomeServer):
elif name == "client":
resource = JsonResource(self, canonical_json=False)
KeyUploadServlet(self).register(resource)
PresenceStatusStubServlet(self).register(resource)
resources.update({
"/_matrix/client/r0": resource,
"/_matrix/client/unstable": resource,
+3
View File
@@ -117,6 +117,7 @@ class SynchrotronPresence(object):
logger.info("Presence process_id is %r", self.process_id)
def send_user_sync(self, user_id, is_syncing, last_sync_ms):
return
self.hs.get_tcp_replication().send_user_sync(user_id, is_syncing, last_sync_ms)
def mark_as_coming_online(self, user_id):
@@ -214,6 +215,8 @@ class SynchrotronPresence(object):
yield self.notify_from_replication(states, stream_id)
def get_currently_syncing_users(self):
# presence is disabled on matrix.org, so we return the empty set
return set()
return [
user_id for user_id, count in self.user_to_num_current_syncs.iteritems()
if count > 0
+17 -11
View File
@@ -182,17 +182,22 @@ class TransactionQueue(object):
if not is_mine and send_on_behalf_of is None:
continue
# Get the state from before the event.
# We need to make sure that this is the state from before
# the event and not from after it.
# Otherwise if the last member on a server in a room is
# banned then it won't receive the event because it won't
# be in the room after the ban.
destinations = yield self.state.get_current_hosts_in_room(
event.room_id, latest_event_ids=[
prev_id for prev_id, _ in event.prev_events
],
)
try:
# Get the state from before the event.
# We need to make sure that this is the state from before
# the event and not from after it.
# Otherwise if the last member on a server in a room is
# banned then it won't receive the event because it won't
# be in the room after the ban.
destinations = yield self.state.get_current_hosts_in_room(
event.room_id, latest_event_ids=[
prev_id for prev_id, _ in event.prev_events
],
)
except Exception:
logger.exception("Failed to calculate hosts in room")
continue
destinations = set(destinations)
if send_on_behalf_of is not None:
@@ -250,6 +255,7 @@ class TransactionQueue(object):
Args:
states (list(UserPresenceState))
"""
return
# First we queue up the new presence by user ID, so multiple presence
# updates in quick successtion are correctly handled
+1
View File
@@ -372,6 +372,7 @@ class InitialSyncHandler(BaseHandler):
@defer.inlineCallbacks
def get_presence():
defer.returnValue([])
states = yield presence_handler.get_states(
[m.user_id for m in room_members],
as_event=True,
+1 -1
View File
@@ -454,7 +454,7 @@ class MessageHandler(BaseHandler):
# If this is an AS, double check that they are allowed to see the members.
# This can either be because the AS user is in the room or becuase there
# is a user in the room that the AS is "interested in"
if requester.app_service and user_id not in users_with_profile:
if False and requester.app_service and user_id not in users_with_profile:
for uid in users_with_profile:
if requester.app_service.is_interested_in_user(uid):
break
+5
View File
@@ -372,6 +372,7 @@ class PresenceHandler(object):
"""We've seen the user do something that indicates they're interacting
with the app.
"""
return
user_id = user.to_string()
bump_active_time_counter.inc()
@@ -401,6 +402,7 @@ class PresenceHandler(object):
Useful for streams that are not associated with an actual
client that is being used by a user.
"""
affect_presence = False
if affect_presence:
curr_sync = self.user_to_num_current_syncs.get(user_id, 0)
self.user_to_num_current_syncs[user_id] = curr_sync + 1
@@ -443,6 +445,8 @@ class PresenceHandler(object):
Returns:
set(str): A set of user_id strings.
"""
# presence is disabled on matrix.org, so we return the empty set
return set()
syncing_user_ids = {
user_id for user_id, count in self.user_to_num_current_syncs.items()
if count
@@ -462,6 +466,7 @@ class PresenceHandler(object):
syncing_user_ids(set(str)): The set of user_ids that are
currently syncing on that server.
"""
return
# Grab the previous list of user_ids that were syncing on that process
prev_syncing_user_ids = (
+1 -1
View File
@@ -44,7 +44,7 @@ EMTPY_THIRD_PARTY_ID = ThirdPartyInstanceID(None, None)
class RoomListHandler(BaseHandler):
def __init__(self, hs):
super(RoomListHandler, self).__init__(hs)
self.response_cache = ResponseCache(hs)
self.response_cache = ResponseCache(hs, timeout_ms=10 * 60 * 1000)
self.remote_response_cache = ResponseCache(hs, timeout_ms=30 * 1000)
def get_local_public_room_list(self, limit=None, since_token=None,
+80 -72
View File
@@ -27,7 +27,7 @@ from synapse.api.constants import (
)
from synapse.api.errors import AuthError, SynapseError, Codes
from synapse.types import UserID, RoomID
from synapse.util.async import Linearizer
from synapse.util.async import Linearizer, Limiter
from synapse.util.distributor import user_left_room, user_joined_room
from ._base import BaseHandler
@@ -48,6 +48,7 @@ class RoomMemberHandler(BaseHandler):
self.profile_handler = hs.get_profile_handler()
self.member_linearizer = Linearizer(name="member")
self.member_limiter = Limiter(3)
self.clock = hs.get_clock()
self.spam_checker = hs.get_spam_checker()
@@ -267,87 +268,94 @@ class RoomMemberHandler(BaseHandler):
if same_sender and same_membership and same_content:
defer.returnValue(old_state)
is_host_in_room = yield self._is_host_in_room(current_state_ids)
# hotfix branch limiter to ensure only join changes get limited
if requester.app_service:
as_id = requester.app_service.id
else:
as_id = object() # no limit
if effective_membership_state == Membership.JOIN:
if requester.is_guest:
guest_can_join = yield self._can_guest_join(current_state_ids)
if not guest_can_join:
# This should be an auth check, but guests are a local concept,
# so don't really fit into the general auth process.
raise AuthError(403, "Guest access not allowed")
if not is_host_in_room:
inviter = yield self.get_inviter(target.to_string(), room_id)
if inviter and not self.hs.is_mine(inviter):
remote_room_hosts.append(inviter.domain)
content["membership"] = Membership.JOIN
profile = self.profile_handler
if not content_specified:
content["displayname"] = yield profile.get_displayname(target)
content["avatar_url"] = yield profile.get_avatar_url(target)
with (yield self.member_limiter.queue(as_id)):
is_host_in_room = yield self._is_host_in_room(current_state_ids)
if effective_membership_state == Membership.JOIN:
if requester.is_guest:
content["kind"] = "guest"
guest_can_join = yield self._can_guest_join(current_state_ids)
if not guest_can_join:
# This should be an auth check, but guests are a local concept,
# so don't really fit into the general auth process.
raise AuthError(403, "Guest access not allowed")
ret = yield self.remote_join(
remote_room_hosts, room_id, target, content
)
defer.returnValue(ret)
if not is_host_in_room:
inviter = yield self.get_inviter(target.to_string(), room_id)
if inviter and not self.hs.is_mine(inviter):
remote_room_hosts.append(inviter.domain)
elif effective_membership_state == Membership.LEAVE:
if not is_host_in_room:
# perhaps we've been invited
inviter = yield self.get_inviter(target.to_string(), room_id)
if not inviter:
raise SynapseError(404, "Not a known room")
content["membership"] = Membership.JOIN
if self.hs.is_mine(inviter):
# the inviter was on our server, but has now left. Carry on
# with the normal rejection codepath.
#
# This is a bit of a hack, because the room might still be
# active on other servers.
pass
else:
# send the rejection to the inviter's HS.
remote_room_hosts = remote_room_hosts + [inviter.domain]
fed_handler = self.hs.get_handlers().federation_handler
try:
ret = yield fed_handler.do_remotely_reject_invite(
remote_room_hosts,
room_id,
target.to_string(),
)
defer.returnValue(ret)
except Exception as e:
# if we were unable to reject the exception, just mark
# it as rejected on our end and plough ahead.
profile = self.profile_handler
if not content_specified:
content["displayname"] = yield profile.get_displayname(target)
content["avatar_url"] = yield profile.get_avatar_url(target)
if requester.is_guest:
content["kind"] = "guest"
ret = yield self.remote_join(
remote_room_hosts, room_id, target, content
)
defer.returnValue(ret)
elif effective_membership_state == Membership.LEAVE:
if not is_host_in_room:
# perhaps we've been invited
inviter = yield self.get_inviter(target.to_string(), room_id)
if not inviter:
raise SynapseError(404, "Not a known room")
if self.hs.is_mine(inviter):
# the inviter was on our server, but has now left. Carry on
# with the normal rejection codepath.
#
# The 'except' clause is very broad, but we need to
# capture everything from DNS failures upwards
#
logger.warn("Failed to reject invite: %s", e)
# This is a bit of a hack, because the room might still be
# active on other servers.
pass
else:
# send the rejection to the inviter's HS.
remote_room_hosts = remote_room_hosts + [inviter.domain]
fed_handler = self.hs.get_handlers().federation_handler
try:
ret = yield fed_handler.do_remotely_reject_invite(
remote_room_hosts,
room_id,
target.to_string(),
)
defer.returnValue(ret)
except Exception as e:
# if we were unable to reject the exception, just mark
# it as rejected on our end and plough ahead.
#
# The 'except' clause is very broad, but we need to
# capture everything from DNS failures upwards
#
logger.warn("Failed to reject invite: %s", e)
yield self.store.locally_reject_invite(
target.to_string(), room_id
)
yield self.store.locally_reject_invite(
target.to_string(), room_id
)
defer.returnValue({})
defer.returnValue({})
res = yield self._local_membership_update(
requester=requester,
target=target,
room_id=room_id,
membership=effective_membership_state,
txn_id=txn_id,
ratelimit=ratelimit,
prev_event_ids=latest_event_ids,
content=content,
)
defer.returnValue(res)
res = yield self._local_membership_update(
requester=requester,
target=target,
room_id=room_id,
membership=effective_membership_state,
txn_id=txn_id,
ratelimit=ratelimit,
prev_event_ids=latest_event_ids,
content=content,
)
defer.returnValue(res)
@defer.inlineCallbacks
def send_membership_event(
+1 -1
View File
@@ -585,7 +585,7 @@ class SyncHandler(object):
since_token is None and
sync_config.filter_collection.blocks_all_presence()
)
if not block_all_presence_data:
if False and not block_all_presence_data:
yield self._generate_sync_entry_for_presence(
sync_result_builder, newly_joined_rooms, newly_joined_users
)
+1 -1
View File
@@ -210,7 +210,7 @@ class EmailPusher(object):
def seconds_until(self, ts_msec):
secs = (ts_msec - self.clock.time_msec()) / 1000
return max(secs, 0)
return max(secs, 0) # Ensure non-negative
def get_room_throttle_ms(self, room_id):
if room_id in self.throttle_params:
@@ -42,6 +42,8 @@ class SlavedClientIpStore(BaseSlavedStore):
if last_seen is not None and (now - last_seen) < LAST_SEEN_GRANULARITY:
return
self.client_ip_last_seen.prefill(key, now)
self.hs.get_tcp_replication().send_user_ip(
user_id, access_token, ip, user_agent, device_id, now
)
+1 -1
View File
@@ -33,7 +33,7 @@ import logging
logger = logging.getLogger(__name__)
MAX_EVENTS_BEHIND = 10000
MAX_EVENTS_BEHIND = 500000
EventStreamRow = namedtuple("EventStreamRow", (
+12 -12
View File
@@ -203,18 +203,6 @@ class ShutdownRoomRestServlet(ClientV1RestServlet):
)
new_room_id = info["room_id"]
msg_handler = self.handlers.message_handler
yield msg_handler.create_and_send_nonmember_event(
room_creator_requester,
{
"type": "m.room.message",
"content": {"body": message, "msgtype": "m.text"},
"room_id": new_room_id,
"sender": new_room_user_id,
},
ratelimit=False,
)
requester_user_id = requester.user.to_string()
logger.info("Shutting down room %r", room_id)
@@ -252,6 +240,18 @@ class ShutdownRoomRestServlet(ClientV1RestServlet):
kicked_users.append(user_id)
msg_handler = self.handlers.message_handler
yield msg_handler.create_and_send_nonmember_event(
room_creator_requester,
{
"type": "m.room.message",
"content": {"body": message, "msgtype": "m.text"},
"room_id": new_room_id,
"sender": new_room_user_id,
},
ratelimit=False,
)
aliases_for_room = yield self.store.get_aliases_for_room(room_id)
yield self.store.update_aliases_for_room(
+1 -1
View File
@@ -81,7 +81,7 @@ class PresenceStatusRestServlet(ClientV1RestServlet):
except Exception:
raise SynapseError(400, "Unable to parse state")
yield self.presence_handler.set_state(user, state)
# yield self.presence_handler.set_state(user, state)
defer.returnValue((200, {}))
+1
View File
@@ -477,6 +477,7 @@ class RoomInitialSyncRestServlet(ClientV1RestServlet):
@defer.inlineCallbacks
def on_GET(self, request, room_id):
# raise RuntimeError("Guest access has been disabled")
requester = yield self.auth.get_user_by_req(request, allow_guest=True)
pagination_config = PaginationConfig.from_request(request)
content = yield self.initial_sync_handler.room_initial_sync(
+1 -1
View File
@@ -28,7 +28,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
class ClientIpStore(background_updates.BackgroundUpdateStore):
+6 -3
View File
@@ -87,6 +87,8 @@ class EventPushActionsStore(SQLBaseStore):
self._rotate_notif_loop = self._clock.looping_call(
self._rotate_notifs, 30 * 60 * 1000
)
self._rotate_delay = 3
self._rotate_count = 10000
def _set_push_actions_for_event_and_users_txn(self, txn, event, tuples):
"""
@@ -629,7 +631,7 @@ class EventPushActionsStore(SQLBaseStore):
)
if caught_up:
break
yield sleep(5)
yield sleep(self._rotate_delay)
finally:
self._doing_notif_rotation = False
@@ -650,9 +652,10 @@ class EventPushActionsStore(SQLBaseStore):
txn.execute("""
SELECT stream_ordering FROM event_push_actions
WHERE stream_ordering > ?
ORDER BY stream_ordering ASC LIMIT 1 OFFSET 50000
""", (old_rotate_stream_ordering,))
ORDER BY stream_ordering ASC LIMIT 1 OFFSET ?
""", (old_rotate_stream_ordering, self._rotate_count))
stream_row = txn.fetchone()
# stream_row = (old_rotate_stream_ordering + self._rotate_count,)
if stream_row:
offset_stream_ordering, = stream_row
rotate_to_stream_ordering = min(
-1
View File
@@ -1014,7 +1014,6 @@ class EventsStore(SQLBaseStore):
"event_edge_hashes",
"event_edges",
"event_forward_extremities",
"event_push_actions",
"event_reference_hashes",
"event_search",
"event_signatures",
+3 -1
View File
@@ -310,6 +310,7 @@ class RoomStore(SQLBaseStore):
def _store_event_search_txn(self, txn, event, key, value):
if isinstance(self.database_engine, PostgresEngine):
txn.execute("SET work_mem='256kB'")
sql = (
"INSERT INTO event_search"
" (event_id, room_id, key, vector, stream_ordering, origin_server_ts)"
@@ -323,6 +324,7 @@ class RoomStore(SQLBaseStore):
event.origin_server_ts,
)
)
txn.execute("RESET work_mem")
elif isinstance(self.database_engine, Sqlite3Engine):
sql = (
"INSERT INTO event_search (event_id, room_id, key, value)"
@@ -589,7 +591,7 @@ class RoomStore(SQLBaseStore):
"""
UPDATE remote_media_cache
SET quarantined_by = ?
WHERE media_origin AND media_id = ?
WHERE media_origin = ? AND media_id = ?
""",
(
(quarantined_by, origin, media_id)
+1 -1
View File
@@ -675,7 +675,7 @@ class RoomMemberStore(SQLBaseStore):
defer.returnValue(result)
@cached(max_entries=10000, iterable=True)
@cached(max_entries=10000)
def _get_joined_hosts_cache(self, room_id):
return _JoinedHostsCache(self, room_id)
+5 -1
View File
@@ -106,6 +106,7 @@ class SearchStore(BackgroundUpdateStore):
event_search_rows.append((event_id, room_id, key, value))
if isinstance(self.database_engine, PostgresEngine):
txn.execute("SET work_mem='256kB'")
sql = (
"INSERT INTO event_search (event_id, room_id, key, vector)"
" VALUES (?,?,?,to_tsvector('english', ?))"
@@ -123,6 +124,9 @@ class SearchStore(BackgroundUpdateStore):
clump = event_search_rows[index:index + INSERT_CLUMP_SIZE]
txn.executemany(sql, clump)
if isinstance(self.database_engine, PostgresEngine):
txn.execute("RESET work_mem")
progress = {
"target_min_stream_id_inclusive": target_min_stream_id,
"max_stream_id_exclusive": min_stream_id,
@@ -600,7 +604,7 @@ def _parse_query(database_engine, search_term):
results = re.findall(r"([\w\-]+)", search_term, re.UNICODE)
if isinstance(database_engine, PostgresEngine):
return " & ".join(result + ":*" for result in results)
return " & ".join(result for result in results)
elif isinstance(database_engine, Sqlite3Engine):
return " & ".join(result + "*" for result in results)
else:
+2 -3
View File
@@ -57,7 +57,7 @@ class StateGroupReadStore(SQLBaseStore):
super(StateGroupReadStore, self).__init__(db_conn, hs)
self._state_group_cache = DictionaryCache(
"*stateGroupCache*", 100000 * CACHE_SIZE_FACTOR
"*stateGroupCache*", 500000 * CACHE_SIZE_FACTOR
)
@cached(max_entries=100000, iterable=True)
@@ -535,8 +535,7 @@ class StateGroupReadStore(SQLBaseStore):
state_dict = results[group]
state_dict.update(
((intern_string(k[0]), intern_string(k[1])), to_ascii(v))
for k, v in group_state_dict.iteritems()
group_state_dict.iteritems()
)
self._state_group_cache.update(
+7 -5
View File
@@ -987,11 +987,13 @@ class RoomInitialSyncTestCase(RestTestCase):
self.assertTrue("presence" in response)
presence_by_user = {
e["content"]["user_id"]: e for e in response["presence"]
}
self.assertTrue(self.user_id in presence_by_user)
self.assertEquals("m.presence", presence_by_user[self.user_id]["type"])
# presence is turned off on hotfixes
# presence_by_user = {
# e["content"]["user_id"]: e for e in response["presence"]
# }
# self.assertTrue(self.user_id in presence_by_user)
# self.assertEquals("m.presence", presence_by_user[self.user_id]["type"])
class RoomMessageListTestCase(RestTestCase):