Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Delete a room (Admin API) #6425

Closed
rxl881 opened this issue Nov 27, 2019 · 6 comments · Fixed by #7613
Closed

Delete a room (Admin API) #6425

rxl881 opened this issue Nov 27, 2019 · 6 comments · Fixed by #7613
Assignees
Labels
A-Admin-API z-feature (Deprecated Label)

Comments

@rxl881
Copy link

rxl881 commented Nov 27, 2019

Description:

Server admins are requesting a way to "delete rooms" and it would be good to create some tooling to help with this.

It is possible that this could just be a call to the "room shutdown" API (currently undocumented?) followed by a call to "room purge" admin API? But it would be good to know if this is the correct way to be doing so, and is probably beneficial to combine it in to a single API call?

@richvdh
Copy link
Member

richvdh commented Nov 27, 2019

"room shutdown" API (currently undocumented?)

#4784

I really wish people wouldn't write APIs without documenting them.

@vapaa
Copy link

vapaa commented Apr 24, 2020

is there any progress on this topic?

@neilisfragile
Copy link
Contributor

Impl here #2291
Doc'd here #6541

@aaronraimist
Copy link
Contributor

@neilisfragile wasn't the request here for a new API that would combine the room shutdown API and the purge room API into one request?

@neilisfragile
Copy link
Contributor

@aaronraimist good point, thanks for the catch.

@neilisfragile neilisfragile reopened this Apr 27, 2020
@awesome-manuel
Copy link
Contributor

awesome-manuel commented Apr 28, 2020

The API should be DELETE /_synapse/admin/v1/rooms/<room-id>
Internally the API should:

  • Kick all Users from this room
  • Purge room content
  • Remove room

See also #7317

richvdh pushed a commit that referenced this issue Jul 14, 2020
The Delete Room admin API allows server admins to remove rooms from server
and block these rooms.
`DELETE /_synapse/admin/v1/rooms/<room_id>`
It is a combination and improvement of "[Shutdown room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/shutdown_room.md)" and "[Purge room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/purge_room.md)" API.

Fixes: #6425 

It also fixes a bug in [synapse/storage/data_stores/main/room.py](synapse/storage/data_stores/main/room.py) in ` get_room_with_stats`.
It should return `None` if the room is unknown. But it returns an `IndexError`.
https://github.com/matrix-org/synapse/blob/901b1fa561e3cc661d78aa96d59802cf2078cb0d/synapse/storage/data_stores/main/room.py#L99-L105

Related to:
- #5575
- Awesome-Technologies/synapse-admin#17

Signed-off-by: Dirk Klimpel [email protected]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Admin-API z-feature (Deprecated Label)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants