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

purge_history api does not delete media #12046

Closed
SPiRiT369 opened this issue Feb 20, 2022 · 6 comments
Closed

purge_history api does not delete media #12046

SPiRiT369 opened this issue Feb 20, 2022 · 6 comments
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@SPiRiT369
Copy link

I want to delete old room messages. (unencrypted room)

I use purge_history call (/_synapse/admin/v1/purge_history/<room_id>) and it does the work. However, if the deleted events contain uploaded media - they are removed from the room but not from the disk.

Please fix it so purge_history will also delete files from disk.

A workaround for this issue could be to use the delete media api, but it works on all rooms, and I want to clean history on specific rooms only.

@dklimpel
Copy link
Contributor

IMO this is not possible. Purge history deletes also encrypted events. And the server does not know the content / media files of this event.
Also you can use a media in multiple events.

@SPiRiT369
Copy link
Author

If the room is unencrypted then it's possible to delete those files I think. Because it's possible to list room media via api.

@dklimpel
Copy link
Contributor

Related #10176

@SPiRiT369
Copy link
Author

It is not related. It's for empty rooms. I am speaking about active rooms that I want to clean old messages in them.

@squahtx squahtx added the T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. label Feb 21, 2022
@richvdh
Copy link
Member

richvdh commented Feb 21, 2022

The difficulty here is that media is not particularly linked to a specific event (or even room): there is nothing to say a single media url has not been used in multiple places.

This is covered by a range of existing issues, such as #1263, #6832, https://github.com/matrix-org/matrix-doc/issues/701, matrix-org/matrix-spec-proposals#2278

@richvdh richvdh closed this as completed Feb 21, 2022
@SPiRiT369
Copy link
Author

Oh @richvdh thank you for this info. I didn't know that it's a duplicate. Sorry for creating another one.
At least it's a known issue. I hope it will be solved somewhere soon. Synapse leaves too much storage junk 😕
Thanks again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

No branches or pull requests

4 participants