Cleaning up orphaned attachments in S3 storage

Hi,
I’m testing Gitea 1.27 with attachments stored in Backblaze B2.

I uploaded a file to an issue comment, confirmed it was saved in the bucket, and then deleted the comment. The file is still in B2 afterwards.

Is that expected? I assumed deleting the comment would also remove its attachment, or that Gitea would have a supported cleanup process for these files.

I ran the attachment storage check as well. It finds the orphaned file, but even with --fix, the file remains in the bucket and no error is shown.

What is the recommended way to clean up these orphaned attachments safely?

The behavior you describe on Gitea 1.27—–fix reporting the orphan but leaving it in Backblaze B2—suggests the cleanup path is not deleting remote objects, rather than comment deletion itself being a retention guarantee. Before removing anything manually, check the instance logs around the attachment check and verify the B2 bucket, prefix, and credentials are the same ones Gitea is using.