element-hq / element-hq/synapse
/createRoom creates an empty room when there is an error sending events
- 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)

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
Assessment
This issue has not been assessed yet.