diff options
author | Mathieu Velten <mathieuv@matrix.org> | 2022-08-03 14:46:46 +0200 |
---|---|---|
committer | Mathieu Velten <mathieuv@matrix.org> | 2022-08-03 14:46:46 +0200 |
commit | 4cc2f3e9901bb545fa103a550630eda93bab84f5 (patch) | |
tree | c3b3186713ad40c31f282f29d658fc2ec1955114 | |
parent | Type mistake (diff) | |
download | synapse-4cc2f3e9901bb545fa103a550630eda93bab84f5.tar.xz |
Use org.matrix.unstable prefix
-rw-r--r-- | changelog.d/13412.feature | 2 | ||||
-rw-r--r-- | synapse/api/filtering.py | 6 | ||||
-rw-r--r-- | tests/rest/client/test_sync.py | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/changelog.d/13412.feature b/changelog.d/13412.feature index 1b5f6128bc..26ba06a293 100644 --- a/changelog.d/13412.feature +++ b/changelog.d/13412.feature @@ -1 +1 @@ -Add `do_not_use_to_device_limit` field to sync filter. This is an experiment to see if it improves sync performance. +Add `org.matrix.unstable.to_device_limit` field to sync filter. This is an experiment to see if it improves sync performance. diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py index 69203fb2dd..45ea51316f 100644 --- a/synapse/api/filtering.py +++ b/synapse/api/filtering.py @@ -136,7 +136,7 @@ USER_FILTER_SCHEMA = { }, # This is an experiment, a MSC will follow if it happens to be useful # for clients sync performance - "do_not_use_to_device_limit": {"type": "number"}, + "org.matrix.unstable.to_device_limit": {"type": "number"}, }, "additionalProperties": False, } @@ -224,7 +224,9 @@ class FilterCollection: self.to_device_limit = 100 if hs.config.experimental.to_device_limit_enabled: - self.to_device_limit = filter_json.get("do_not_use_to_device_limit", 100) + self.to_device_limit = filter_json.get( + "org.matrix.unstable.to_device_limit", 100 + ) # We don't want to overload the server so let's limit it to under a thousand if self.to_device_limit > 1000: self.to_device_limit = 1000 diff --git a/tests/rest/client/test_sync.py b/tests/rest/client/test_sync.py index 6937dd4489..e45436af4f 100644 --- a/tests/rest/client/test_sync.py +++ b/tests/rest/client/test_sync.py @@ -991,7 +991,7 @@ class ToDeviceLimitTestCase(unittest.HomeserverTestCase): ) self.assertEqual(chan.code, 200, chan.result) - # This does an incremental sync for user kermit with do_not_use_to_device_limit + # This does an incremental sync for user kermit with org.matrix.unstable.to_device_limit # setted and check the number of returned to_device msgs against # expected_to_device_msgs value def _limited_sync_and_check( @@ -999,7 +999,7 @@ class ToDeviceLimitTestCase(unittest.HomeserverTestCase): ) -> None: channel = self.make_request( "GET", - f'/sync?since={self.next_batch}&filter={{"do_not_use_to_device_limit": {to_device_limit}}}', + f'/sync?since={self.next_batch}&filter={{"org.matrix.unstable.to_device_limit": {to_device_limit}}}', access_token=self.tok, ) self.assertEqual(channel.code, 200) |