Adds new file attachment deletion logic in the PhabricatorFile object from the file side and destruction engine extension from the object side and SQL patch for existing leftover attachments from deleted files.
Closes T15110
Differential D25051
Destroy file attachments when file is deleted Dylsss on Sep 12 2022, 13:25. Authored by Tags Referenced Files
Details
Adds new file attachment deletion logic in the PhabricatorFile object from the file side and destruction engine extension from the object side and SQL patch for existing leftover attachments from deleted files. Closes T15110 Upload file, delete file. No Unknown Object in Referenced Files curtain.
Diff Detail
Event TimelineComment Actions I'm very curious about this improvement. Feel free to share a comment about your current concerns on this change. I ask this since it's indicated as "planned changes". Comment Actions Organised attachment deletion from the file side into the File object and deletion from the object side into the destruction engine extension. Also updated the SQL patch date in the file name.
Comment Actions PhabricatorFileAttachmentQuery seems to eagerly load the object relation, however since the DestructionEngine extensions run after the object is already deleted, this fails and nothing is returned in the query. Changed to LiskDAO loadAllWhere, which also seems to use less queries in general (due to not eagerly loading), so changed the query in PhabricatorFile as well. Changed mpull to foreach per suggestion.
|