With default rate limiting values, we used to be able to create at least 3 rooms in one go. The new Space screen in Element Web depends on this (element-hq/element-web#23620) and breaks if any of those room creations are rate limited, as they are now (v1.70.0).
The following test case demonstrates this:
from http import HTTPStatus
from synapse.rest.client import room
from tests.unittest import HomeserverTestCase, override_config
class BisectCase(HomeserverTestCase):
servlets = [room.register_servlets]
hijack_auth = True
user_id = "@sid1:test"
@override_config({
"rc_message": {"per_second": 0.2, "burst_count": 10},
})
def test_can_create_3_rooms(self):
"""
Should be able to create 3 rooms in a row (e.g. rooms in a space)
without hitting rate limits.
"""
for _ in range(3):
channel = self.make_request(
"POST",
"/createRoom",
{},
)
self.assertEqual(channel.code, HTTPStatus.OK, channel.json_body)
Bisecting, the following commit is what made the above fail because of the rate limit: 8ab16a9 'Persist CreateRoom events to DB in a batch (#13800)' in v1.69.0.
We should try to revert rate limiting to behave the same as before or closely enough that this basic use case is not broken.