Attachments with option delete: false are not orphaned when model is deleted

Hi, I’m using the delete = false option on some file attachments for a project with more advanced content publishing needs.

The idea is that when a file is removed from a model, I don’t want it to be automatically deleted from disk. Instead, I want the file record to remain temporarily, and then later clean it up safely using purge orphans and purge uploads.

This works fine when I remove the file from the model and save it: the related system_files record becomes orphaned and is later picked up correctly by purge orphans.

The problem appears when I delete the entire model.

In that case, the related system_files record does not become orphaned. The attachment_id, attachment_type, and file fields are still populated, so the file is not detected as an orphan and therefore is never removed by purge orphans.

Is this expected behavior, or should those relations be cleared when deleting a model if delete = false is being used?