element-hq / element-hq/synapse

`on_create_room` Module API callback encourages using `SynapseError` to deny creating a room

Open
#11,123 0 comments 0 reactions 0 assignees View on GitHub
A-Modules T-Task
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#11123](https://github.com/matrix-org/synapse/issues/11123).

---

We had a discussion recently more or less along the lines of 'modules shouldn't know about `SynapseError`s (except for use with their own web resources)', but I just noticed that the `on_create_room` callback encourages/requires doing it that way.

Should we add an alternative? (e.g.: `return False, "failure message"`?)

https://github.com/matrix-org/synapse/blob/5e0e6835416776e4d938f53b3c9a005970f88127/docs/modules/third_party_rules_callbacks.md?plain=1#L68-L69

Contributor guide

Open the contributing guide

Research direction

Read docs/modules/third_party_rules_callbacks.md at the on_create_room callback description and review how it currently describes denying room creation with SynapseError. Define an alternative rejection contract that keeps module callbacks independent of SynapseError, then update the callback API and its documentation; the issue does not name tests or implementation files.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.