MSC4140: allow auth on management endpoints for delayed events#19794
Merged
anoadragon453 merged 10 commits intoJun 18, 2026
Conversation
This is to allow authed requests to have their own ratelimit quotas.
Plus, since element-hq#19152, the delayed event management ratelimit hasn't considered the requesting device ID, so don't mention that anymore.
4 tasks
2 tasks
pull Bot
pushed a commit
to Reality2byte/matrix-js-sdk
that referenced
this pull request
May 26, 2026
* MSC4140: use auth for delayed event management Do this to let ratelimiting apply per user instead of per source IP address, if the server supports that. See element-hq/synapse#19794 * Add comment to explain why auth is being used
3 tasks
7 tasks
AndrewFerr
commented
Jun 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Enables authenticated requests to delayed event management endpoints (MSC4140) to be rate-limited based on the authenticated user rather than the source IP, so authenticated clients can have their own quotas distinct from unauthenticated/IP-based traffic.
Changes:
- Add a shared
_mgmt_ratelimithelper inDelayedEventsHandlerthat switches ratelimiting keys between authenticated user and unauthenticated source IP. - Expand delayed event management ratelimit tests to cover the “authenticated bypasses IP ratelimit” behavior and per-user override disabling ratelimits.
- Update configuration schema/docs wording to reflect the new ratelimiting behavior, and add a Towncrier feature fragment.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/rest/client/test_delayed_events.py |
Updates ratelimit tests to cover authenticated-vs-unauthenticated quotas and user ratelimit overrides. |
synapse/handlers/delayed_events.py |
Implements auth-aware ratelimiting for delayed event cancel/restart/send; simplifies user listing ratelimit keying. |
schema/synapse-config.schema.yaml |
Updates config schema description for rc_delayed_event_mgmt to match new behavior. |
docs/usage/configuration/config_documentation.md |
Updates user-facing config docs description for delayed event management ratelimiting. |
changelog.d/19794.feature |
Adds Towncrier newsfragment describing the new authenticated behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
anoadragon453
approved these changes
Jun 18, 2026
anoadragon453
left a comment
Member
There was a problem hiding this comment.
Just some minor wording changes. Otherwise this LGTM!
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
AndrewFerr
added a commit
to AndrewFerr/synapse
that referenced
this pull request
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is to allow authed requests to have their own ratelimit quotas.
MSC4140
Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.