New request
#16205: In self‑hosted Twenty with local storage, deleted avatars and attachments are not removed from disk
We'll provision a sandbox, run an agent against the issue, and open a draft PR. You can pull the branch and iterate from there.
Issue
prio: medium
Bug Description
In a self‑hosted Twenty instance using local storage (filesystem) for files, deleting an avatar or an attachment from the UI removes it logically in the app, but the underlying file is not deleted from the storage folder. This looks functionally similar to the S3 storage issue described in #13191 but happens when using local storage instead of S3
Observed behavior:
- Workspace is self‑hosted (Docker), storage set to local filesystem (not S3).
- Create an object (for example: user avatar, note, or record with attachment).
- Upload an image/file.
- From the UI, delete the avatar or remove the attachment.
- After refresh, the avatar/attachment no longer appears in the app, but the corresponding file is still present on disk in the local storage directory (and continues to occupy space).
Expected behavior
When an avatar or attachment is deleted from the UI:
- The application should also delete the corresponding file from the local storage directory (or at least mark and clean it up via a background job).
- Disk usage for file storage should not keep growing due to orphaned files that are no longer referenced by any object.
Twenty version: v1.12.0
<img width="740" height="140" alt="Image" src="https://github.com/user-attachments/assets/2b13f070-43a5-441f-8d8e-0e6807059942" /> <img width="941" height="155" alt="Image" src="https://github.com/user-attachments/assets/2b42f53f-f0d8-4cbd-9b94-ca05bcc6c6d0" />Assessmentadvisory
bug●● medium90% confidence
Local storage driver omits physical file deletion when attachments or avatars are removed.
Likely files
- packages/twenty-server/src/engine/core-modules/file-storage/drivers/local.driver.ts
- packages/twenty-server/src/engine/core-modules/file-storage/file-storage.service.ts
- packages/twenty-server/src/engine/metadata-modules/attachment/services/attachment.service.ts
- packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts
Create the request