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

Commit a5f7aff

Browse files
authored
Deprecate Shutdown Room and Purge Room Admin API (#8829)
Deprecate both APIs in favour of the Delete Room API. Related: #8663 and #8810
1 parent 344ab0b commit a5f7aff

File tree

5 files changed

+63
-11
lines changed

5 files changed

+63
-11
lines changed

CHANGES.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Synapse 1.25.0 (2020-xx-xx)
2+
===========================
3+
4+
Removal warning
5+
---------------
6+
7+
The old [Purge Room API](https://github.com/matrix-org/synapse/tree/master/docs/admin_api/purge_room.md)
8+
and [Shutdown Room API](https://github.com/matrix-org/synapse/tree/master/docs/admin_api/shutdown_room.md)
9+
are deprecated and will be removed in a future release. They will be replaced by the
10+
[Delete Room API](https://github.com/matrix-org/synapse/tree/master/docs/admin_api/rooms.md#delete-room-api).
11+
12+
`POST /_synapse/admin/v1/rooms/<room_id>/delete` replaces `POST /_synapse/admin/v1/purge_room` and
13+
`POST /_synapse/admin/v1/shutdown_room/<room_id>`.
14+
15+
116
Synapse 1.24.0 (2020-12-09)
217
===========================
318

@@ -183,8 +198,6 @@ Internal Changes
183198
- Allow for specifying a room version when creating a room in unit tests via `RestHelper.create_room_as`. ([\#8854](https://github.com/matrix-org/synapse/issues/8854))
184199

185200

186-
187-
188201
Synapse 1.23.0 (2020-11-18)
189202
===========================
190203

changelog.d/8829.removal

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate Shutdown Room and Purge Room Admin APIs.

docs/admin_api/purge_room.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
Purge room API
2-
==============
1+
Deprecated: Purge room API
2+
==========================
3+
4+
**The old Purge room API is deprecated and will be removed in a future release.
5+
See the new [Delete Room API](rooms.md#delete-room-api) for more details.**
36

47
This API will remove all trace of a room from your database.
58

69
All local users must have left the room before it can be removed.
710

8-
See also: [Delete Room API](rooms.md#delete-room-api)
9-
1011
The API is:
1112

1213
```

docs/admin_api/rooms.md

+38-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Contents
2+
- [List Room API](#list-room-api)
3+
* [Parameters](#parameters)
4+
* [Usage](#usage)
5+
- [Room Details API](#room-details-api)
6+
- [Room Members API](#room-members-api)
7+
- [Delete Room API](#delete-room-api)
8+
* [Parameters](#parameters-1)
9+
* [Response](#response)
10+
* [Undoing room shutdowns](#undoing-room-shutdowns)
11+
112
# List Room API
213

314
The List Room admin API allows server admins to get a list of rooms on their
@@ -357,8 +368,6 @@ Response:
357368

358369
The Delete Room admin API allows server admins to remove rooms from server
359370
and block these rooms.
360-
It is a combination and improvement of "[Shutdown room](shutdown_room.md)"
361-
and "[Purge room](purge_room.md)" API.
362371

363372
Shuts down a room. Moves all local users and room aliases automatically to a
364373
new room if `new_room_user_id` is set. Otherwise local users only
@@ -455,3 +464,30 @@ The following fields are returned in the JSON response body:
455464
* `local_aliases` - An array of strings representing the local aliases that were migrated from
456465
the old room to the new.
457466
* `new_room_id` - A string representing the room ID of the new room.
467+
468+
## Undoing room shutdowns
469+
470+
*Note*: This guide may be outdated by the time you read it. By nature of room shutdowns being performed at the database level,
471+
the structure can and does change without notice.
472+
473+
First, it's important to understand that a room shutdown is very destructive. Undoing a shutdown is not as simple as pretending it
474+
never happened - work has to be done to move forward instead of resetting the past. In fact, in some cases it might not be possible
475+
to recover at all:
476+
477+
* If the room was invite-only, your users will need to be re-invited.
478+
* If the room no longer has any members at all, it'll be impossible to rejoin.
479+
* The first user to rejoin will have to do so via an alias on a different server.
480+
481+
With all that being said, if you still want to try and recover the room:
482+
483+
1. For safety reasons, shut down Synapse.
484+
2. In the database, run `DELETE FROM blocked_rooms WHERE room_id = '!example:example.org';`
485+
* For caution: it's recommended to run this in a transaction: `BEGIN; DELETE ...;`, verify you got 1 result, then `COMMIT;`.
486+
* The room ID is the same one supplied to the shutdown room API, not the Content Violation room.
487+
3. Restart Synapse.
488+
489+
You will have to manually handle, if you so choose, the following:
490+
491+
* Aliases that would have been redirected to the Content Violation room.
492+
* Users that would have been booted from the room (and will have been force-joined to the Content Violation room).
493+
* Removal of the Content Violation room if desired.

docs/admin_api/shutdown_room.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Shutdown room API
1+
# Deprecated: Shutdown room API
2+
3+
**The old Shutdown room API is deprecated and will be removed in a future release.
4+
See the new [Delete Room API](rooms.md#delete-room-api) for more details.**
25

36
Shuts down a room, preventing new joins and moves local users and room aliases automatically
47
to a new room. The new room will be created with the user specified by the
@@ -10,8 +13,6 @@ disallow any further invites or joins.
1013
The local server will only have the power to move local user and room aliases to
1114
the new room. Users on other servers will be unaffected.
1215

13-
See also: [Delete Room API](rooms.md#delete-room-api)
14-
1516
## API
1617

1718
You will need to authenticate with an access token for an admin user.

0 commit comments

Comments
 (0)