element-hq / element-hq/synapse

Unable to remove room from directory using appservice token

Open
#5,530 0 comments 0 reactions 0 assignees View on GitHub
A-Application-Service z-bug z-p2
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

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

---

### Description

Trying to remove a room created by an application service from the directory doesn't work.

Synapse responds with 200 and `{}`, but the room is still listed in the directory.

```
❯ curl -i -X DELETE --header 'Accept: application/json' 'http://REDACTED1/_matrix/client/r0/directory/room/REDACTED2?access_token=REDACTED3'
HTTP/1.1 200 OK
Server: Synapse/1.0.0
Date: Mon, 24 Jun 2019 07:01:00 GMT
Content-Type: application/json
Content-Length: 3
Cache-Control: no-cache, no-store, must-revalidate
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization

{}

❯ curl -i -X GET --header 'Accept: application/json' 'http://REDACTED1/_matrix/client/r0/directory/room/REDACTED2?access_token=REDACTED3'
HTTP/1.1 200 OK
Server: Synapse/1.0.0
Date: Mon, 24 Jun 2019 07:01:04 GMT
Content-Type: application/json
Content-Length: 97
Cache-Control: no-cache, no-store, must-revalidate
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization

{
"room_id": "REDACTED",
"servers": [
"REDACTED"
]
}
```

### Steps to reproduce

- Let an application service create some room and an entry in the directory.
- Manually query Synapse using the appservice's token to delete the entry.
- Note that the request succeeds.
- Note that the room is still present in the directory.

### Version information

- **Homeserver**: federated
- **Version**: v1.0.0
- **Install method**: NixOS module and package.
- **Platform**: NixOS

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.