element-hq / element-hq/dendrite

/createRoom API behaviour does not match spec

Open
#3,488 3 comments 0 reactions 0 assignees View on GitHub
good first issue spec-compliance T-Defect
Dominant language
Go
Stars
967
Forks
102
PR merge metrics
No merged PRs in 30d

Description

### Background information

- **Dendrite version or git SHA**: docker main
- **SQLite3 or Postgres?**: sqlite3
- **Running in Docker?**: yes
- **`go version`**: docker main
- **Client used (if applicable)**: matrix-js-sdk

### Description

- **What** is the problem: /createRoom API uses join_rule=invite if preset is unspecified even if visibility is specified
- **Who** is affected: Unclear
- **How** is this bug manifesting: Creating rooms unlike the intent of the creator
- **When** did this first appear: Unclear

https://github.com/element-hq/dendrite/issues/3123#issuecomment-2575539315 for more context

The spec does say to use `visibility` if `preset` is unspecified.

> If unspecified, the server should use the visibility to determine which preset to use. A visibility of public equates to a preset of public_chat and private visibility equates to a preset of private_chat.

https://spec.matrix.org/v1.13/client-server-api/#post_matrixclientv3createroom

### Steps to reproduce

- call /createRoom API with visibility=public
- receive a room via /sync which has join_rule=invite instead of join_rule=public

Contributor guide

Open the contributing guide

Research direction

Start at the /createRoom API handling and reproduce the request with visibility=public and no preset. Compare the resulting join_rule with the Matrix specification's visibility-to-preset behavior; done means a public visibility request produces the intended public room configuration without an explicit preset.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.