This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Fix room creation being rate limited too aggressively since Synapse v1.69.0. #14314
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #14312.
I make special effort to match the old limits, though I've tried to do it in a saner way: we apply the 2 units of ratelimiting upfront atomically rather than perhaps doing some work only to fail persisting the creator's membership event.It doesn't seem to make sense to ratelimit half-way through creating a room — it's much better to avoid the wasted work and avoid half-creating a room (possibly leading to a janky state).
I did match the old limits, but now decided to be twice as lenient — Element Web's space creation screen always did fall over even with the old limits if you were fast enough. Given that we're making room creation more performant, it seems reasonable to apply the same cost as one event send — you're not really hurting anyone by creating empty rooms.
Test included for good measure.