twenty icon indicating copy to clipboard operation
twenty copied to clipboard

Handle deletion of files

Open brendanlaschke opened this issue 1 year ago • 5 comments

Scope & Context

We have currently multiple spots where we create and delete files:

  • Workspace image
  • profile image
  • attachments
  • people pictures
  • ...

Current behavior

Deletion of files at the moment only deletes the records and forgets the file. But the file is still remaining in the storage.

Expected behavior

To prevent storing unnecessary files - they should be deleted.

brendanlaschke avatar Nov 27 '23 19:11 brendanlaschke

I can work on this @FelixMalfait

pacyL2K19 avatar Mar 22 '24 16:03 pacyL2K19

Thanks @pacyL2K19 - I haven't looked into it but this might not be an easy one. I'd probably do something listening to the deletion event?

FelixMalfait avatar Mar 25 '24 09:03 FelixMalfait

Here is the GitStart Ticket for this issue: https://clients.gitstart.com/twenty/5449/tickets/TWNTY-2738

gitstart-app[bot] avatar May 15 '24 06:05 gitstart-app[bot]

Still accurate

charlesBochet avatar Jun 12 '24 12:06 charlesBochet

This should be a listener based on the hard-deletion of the Attachment object.

Additionally, once we have soft-delete, we should probably setup a cron, as the process will look like this:

  • When a person deletes an attachment it is soft-deleted
  • Maybe one day, user will also be able to view the trash/empty the trash directly in the ui (once we implement soft delete)
  • For attachments, we'll have a cron that "empties" the trash, i.e. look at deletedAt and delete the recored over 1 week old for example.

FelixMalfait avatar Jul 10 '24 14:07 FelixMalfait