Skip to content

Support deleting media from non-local storage providers#19665

Open
nexy7574 wants to merge 4 commits intoelement-hq:developfrom
nexy7574:nexy7574/urd/delete-media
Open

Support deleting media from non-local storage providers#19665
nexy7574 wants to merge 4 commits intoelement-hq:developfrom
nexy7574:nexy7574/urd/delete-media

Conversation

@nexy7574
Copy link
Copy Markdown
Contributor

@nexy7574 nexy7574 commented Apr 7, 2026

Adds a new method, delete to the StorageProvider abstract base class. Also implements it for FileStorageProviderBackend. Downstream this is used in matrix-org/synapse-s3-storage-provider#153

This change will allow external storage providers, such as synapse-s3-storage-provider, to delete media from their stores when media is removed. Previously, only media in the local provider would be removed, which means that deployments that stored their media on S3 would end up with dangling files, wasting storage.

Discussed in #synapse-dev:matrix.org

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

Also implements it for `FileStorageProviderBackend`

Signed-off-by: timedout <git@nexy7574.co.uk>
@nexy7574 nexy7574 requested a review from a team as a code owner April 7, 2026 15:36
Signed-off-by: timedout <git@nexy7574.co.uk>
nexy7574 added 2 commits April 7, 2026 17:14
Signed-off-by: timedout <git@nexy7574.co.uk>
Signed-off-by: timedout <git@nexy7574.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants