From ddb44badc4c68eb4221f431a2e18f4d465ea486f Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Tue, 21 Nov 2023 15:57:55 +0100 Subject: [PATCH 1/3] Admin API for server notice: disable rate limit for all calls --- synapse/server_notices/server_notices_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/synapse/server_notices/server_notices_manager.py b/synapse/server_notices/server_notices_manager.py index 9732dbdb6e66..c3552d6c73f8 100644 --- a/synapse/server_notices/server_notices_manager.py +++ b/synapse/server_notices/server_notices_manager.py @@ -226,6 +226,7 @@ async def maybe_invite_user_to_room(self, user_id: str, room_id: str) -> None: target=UserID.from_string(user_id), room_id=room_id, action="invite", + ratelimit=False, ) async def _update_notice_user_profile_if_changed( @@ -268,5 +269,6 @@ async def _update_notice_user_profile_if_changed( target=UserID.from_string(self.server_notices_mxid), room_id=room_id, action="join", + ratelimit=False, content={"displayname": display_name, "avatar_url": avatar_url}, ) From 71cd80fb2182b13deff728cf9dd070a8f8ac60a7 Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Tue, 21 Nov 2023 16:05:38 +0100 Subject: [PATCH 2/3] Add changelog --- changelog.d/16670.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/16670.bugfix diff --git a/changelog.d/16670.bugfix b/changelog.d/16670.bugfix new file mode 100644 index 000000000000..2e90b4d930fc --- /dev/null +++ b/changelog.d/16670.bugfix @@ -0,0 +1 @@ +Disable rate limit for all underlying calls when using the server notice admin API. From fca93c928b75a53b845778b596171ca315d581e1 Mon Sep 17 00:00:00 2001 From: Mathieu Velten Date: Wed, 22 Nov 2023 14:42:18 +0100 Subject: [PATCH 3/3] Update changelog.d/16670.bugfix Co-authored-by: David Robertson --- changelog.d/16670.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/16670.bugfix b/changelog.d/16670.bugfix index 2e90b4d930fc..f1369abc0607 100644 --- a/changelog.d/16670.bugfix +++ b/changelog.d/16670.bugfix @@ -1 +1 @@ -Disable rate limit for all underlying calls when using the server notice admin API. +Consistently bypass rate limits when using the server notice admin API.