element-hq / element-hq/synapse

/createRoom creates an empty room when there is an error sending events

Open
#8,895 1 comment 1 reaction 0 assignees View on GitHub
A-Create-Room P4 S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

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

---

If somehow your createRoom request is too large, like if for example you send a base64 encoded avatar instead of an mxc URL (wrongly) then the request fails with a 413 but a new Empty room is created and sent to the user with none of the parameters the user asked for.

Example request payload:

```json
{
"visibility": "public",
"name": "Test Space 17",
"creation_content": {
"type": "m.space"
},
"initial_state": [
{
"type": "m.room.avatar",
"content": {
"avatar": "data:image/png;base64,iVBOR..............AAAAASUVORK5CYII="
}
},
{
"type": "m.room.guest_access",
"state_key": "",
"content": {
"guest_access": "can_join"
}
}
],
"power_level_content_override": {
"events_default": 100
},
"preset": "private_chat"
}
```

(avatar truncated Github would not let me post)

![image](https://user-images.githubusercontent.com/2403652/101487372-ffb53080-3955-11eb-889b-5e1868dd4b46.png)

Expectation: Empty room is not created.

Possibly related to https://github.com/matrix-org/synapse/issues/8625 but am operating in Monolith mode.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.