element-hq / element-hq/synapse
Delete Local Media Admin APIs unnecessarily requires specifying local server_name
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#9284](https://github.com/matrix-org/synapse/issues/9284).
---
The [Delete Local Media Admin APIs](https://github.com/matrix-org/synapse/blob/v1.26.0/docs/admin_api/media_admin_api.md#delete-local-media) require you to include the server name of your local homeserver in the path parameters. If you provide something other than the correct server name, the request will be rejected.
There doesn't seem to be much point in that, especially when the [remote media deletion admin APIs](https://github.com/matrix-org/synapse/blob/v1.26.0/docs/admin_api/media_admin_api.md#purge-remote-media-api) don't allow specifying a server name.
It's also confusing as people see `POST /_synapse/admin/v1/media//delete?before_ts=` and assume it works for any given server name, as seen here: https://github.com/matrix-org/synapse/issues/3479#issuecomment-770097160
I believe this may have come from existing Media Admin APIs, such as [Quarantine Media](https://github.com/matrix-org/synapse/blob/v1.26.0/docs/admin_api/media_admin_api.md#quarantining-media-by-id), which required a `server_name` path parameter, where any server name could be specified.
We should rework this to remove the requirement of specifying the local server name - which is already known by the homeserver, and possibly make it a bit more obvious from the path that this is for local media only.
Contributor guide
Assessment
This issue has not been assessed yet.