Use org.matrix.unstable prefix
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user