Deleting media does not restore storage quota
I know @taras.smakula you are aware of this, but I looked into the issue a bit and think you can try using this endpoint for deleting media instead of redacting messages to fix the issue of recovering storage quota.
From MMR docs: https://github.com/t2bot/matrix-media-repo/blob/cc7e9e594de20d669e5a64b26c6550d5da146a8e/docs/admin.md?plain=1#L47-L53
Purge individual record
URL:
POST /_matrix/media/unstable/admin/purge/<server>/<media id>?access_token=your_access_token
Note: Prior to v1.3, this endpoint did not require the
/media
component, but does now.
This will delete the media record, regardless of it being local or remote. Can be called by homeserver administrators and the uploader to delete it.
Some edge-cases to think about when addressing this:
- What happens if a moderator in delete's someone else's media post? They do not have the permissions to delete the media for recovering the quota.
- What happens if a user just leaves or deletes a room/photo gallery? That does not reclaim media quota storage unless we explicitly implement it.
- What if the room is shared and we just leave the gallery? We probably should preserve the media unless the media uploader explicitly decides to delete their uploads.
Perhaps it makes sense to have some sort of media manager view where the user can view all media they have uploaded? This would allow the user to remove media that has been "orphaned", where the user no longer has access to the media post as well. Besides seeing the user's remaining quota, perhaps we can also list media size with each item and allow the user to sort by size so they can reclaim space when their remaining storage quota is running out.
FYI @cvwright since most likely you'll need this for iOS.