From f6c9996e09afde56a49fa902b7d0ef4b95380663 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 10 Jun 2025 11:05:33 +0100 Subject: [PATCH 1/2] Mark new module APIs are experimental It's not clear that these won't change as people start to play with them. Let's wait to stabilise them in a future release. --- docs/modules/media_repository_callbacks.md | 10 ++++++++++ docs/modules/ratelimit_callbacks.md | 5 +++++ docs/modules/spam_checker_callbacks.md | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/docs/modules/media_repository_callbacks.md b/docs/modules/media_repository_callbacks.md index 0cee3384bb8..fc371304393 100644 --- a/docs/modules/media_repository_callbacks.md +++ b/docs/modules/media_repository_callbacks.md @@ -14,6 +14,11 @@ _First introduced in Synapse v1.132.0_ async def get_media_config_for_user(user_id: str) -> Optional[JsonDict] ``` +** +Caution: This callback is currently experimental . The method signature or behaviour +may change without notice. +** + Called when processing a request from a client for the [media config endpoint](https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1mediaconfig). @@ -39,6 +44,11 @@ _First introduced in Synapse v1.132.0_ async def is_user_allowed_to_upload_media_of_size(user_id: str, size: int) -> bool ``` +** +Caution: This callback is currently experimental . The method signature or behaviour +may change without notice. +** + Called before media is accepted for upload from a user, in case the module needs to enforce a different limit for the particular user. diff --git a/docs/modules/ratelimit_callbacks.md b/docs/modules/ratelimit_callbacks.md index 3386220e37f..30d94024fab 100644 --- a/docs/modules/ratelimit_callbacks.md +++ b/docs/modules/ratelimit_callbacks.md @@ -14,6 +14,11 @@ _First introduced in Synapse v1.132.0_ async def get_ratelimit_override_for_user(user: str, limiter_name: str) -> Optional[synapse.module_api.RatelimitOverride] ``` +** +Caution: This callback is currently experimental . The method signature or behaviour +may change without notice. +** + Called when constructing a ratelimiter of a particular type for a user. The module can return a `messages_per_second` and `burst_count` to be used, or `None` if the default settings are adequate. The user is represented by their Matrix user ID diff --git a/docs/modules/spam_checker_callbacks.md b/docs/modules/spam_checker_callbacks.md index 6dfa2a7b253..39d7cbc000d 100644 --- a/docs/modules/spam_checker_callbacks.md +++ b/docs/modules/spam_checker_callbacks.md @@ -254,6 +254,11 @@ _First introduced in Synapse v1.132.0_ async def user_may_send_state_event(user_id: str, room_id: str, event_type: str, state_key: str, content: JsonDict) -> Union["synapse.module_api.NOT_SPAM", "synapse.module_api.errors.Codes"] ``` +** +Caution: This callback is currently experimental . The method signature or behaviour +may change without notice. +** + Called when processing a request to [send state events](https://spec.matrix.org/latest/client-server-api/#put_matrixclientv3roomsroomidstateeventtypestatekey) to a room. The arguments passed to this callback are: From a2243bfe03facc44fdb3ff698f166d6ce5c77600 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 10 Jun 2025 11:06:35 +0100 Subject: [PATCH 2/2] newsfile --- changelog.d/18536.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/18536.doc diff --git a/changelog.d/18536.doc b/changelog.d/18536.doc new file mode 100644 index 00000000000..db57be4a835 --- /dev/null +++ b/changelog.d/18536.doc @@ -0,0 +1 @@ +Mark the new module APIs in this release as experimental. \ No newline at end of file