mirror of
https://github.com/outline/outline.git
synced 2026-11-22 05:51:43 +03:00
* fix(storage): destroy attachment row on failed upload in files.create Three throwing paths in files.create (auth failure, size validation, writeFile error) left the pre-created Attachment row in the database. The @BeforeDestroy hook already handles storage cleanup safely, so call attachment.destroy() before throwing in each of those branches. Fixes #13824 * Potential fix for pull request finding 'Prevent unauthorized deletion of another user's attachment' Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Tom Moor <tom.moor@gmail.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>