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

Delete Local Media Admin APIs unnecessarily requires specifying local server_name #9284

Open
anoadragon453 opened this issue Feb 1, 2021 · 3 comments
Labels
A-Admin-API A-Media-Repository Uploading, downloading images and video, thumbnailing T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@anoadragon453
Copy link
Member

anoadragon453 commented Feb 1, 2021

The Delete Local Media Admin APIs 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 don't allow specifying a server name.

It's also confusing as people see POST /_synapse/admin/v1/media/<server_name>/delete?before_ts=<before_ts> and assume it works for any given server name, as seen here: #3479 (comment)

I believe this may have come from existing Media Admin APIs, such as Quarantine Media, 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.

@anoadragon453 anoadragon453 added the T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. label Feb 1, 2021
@anoadragon453
Copy link
Member Author

If that wasn't bad enough, it turns out "Delete Local Media" deletes local copies of remote media as well 🤦

@nukeop
Copy link

nukeop commented Oct 11, 2023

Is this still on the roadmap?

@anoadragon453
Copy link
Member Author

It's not high priority on the Synapse core team's backlog. Anyone is free to contribute a PR though.

Please bump the version of the endpoint when you do so (v1 -> v2) and deprecate v1. Don't delete v1 yet, as lots of tooling will still rely on it.

The deprecation notice should both go in the changelog, as well as the upgrade notes for the relevant version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Admin-API A-Media-Repository Uploading, downloading images and video, thumbnailing T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

No branches or pull requests

3 participants