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

The server_name parameter of the "Delete media by date and size" is unused and confusing #14236

Closed
babolivier opened this issue Oct 19, 2022 · 2 comments

Comments

@babolivier
Copy link
Contributor

The "Delete media by date and size" admin API takes a server_name parameter. This makes it look like we only delete media that were uploaded to the local media repository. However, we only use it to check that it matches the local server's name:

if self.server_name != server_name:
raise SynapseError(HTTPStatus.BAD_REQUEST, "Can only delete local media")

We then proceed to call delete_old_local_media, which, confusingly, deletes local media and local copies of remote media. So remote media is deleted even when the server_name parameter is set to the local server.

@dklimpel
Copy link
Contributor

@clokep
Copy link
Member

clokep commented Oct 19, 2022

duplicates #9284.

@clokep clokep closed this as completed Oct 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants