bvandeusen and Claude Opus 5
39cf81aea6
CI / lint (push) Successful in 2s
CI / extension-version (push) Successful in 3s
CI / frontend-build (push) Successful in 24s
CI / backend-lint-and-test (push) Successful in 28s
CI / integration (push) Successful in 3m49s
fix(cleanup): clear an artist's attachments before the cascade delete ( #3066 )
...
`delete_artist_cascade` could abort partway through, and it aborted after
the irreversible half. Deleting an artist CASCADEs to Post (post.artist_id
is ondelete=CASCADE), which SET NULLs post_attachment.post_id — and
`uq_post_attachment_null_post_sha` is a partial UNIQUE on sha256 ALONE
WHERE post_id IS NULL. So any two of that artist's attachments sharing a
sha collapse onto one another and raise.
That shape is ordinary, not corrupt: `_capture_attachment` deliberately
writes one row per post over a single sha-addressed blob, so a creator who
attaches the same pdf to two posts already has two such rows. A
pre-existing filesystem-import row (post_id NULL) with the same sha
collides on its own.
The images and their on-disk files are deleted and committed in 500-row
batches BEFORE the artist row is touched, so the failure landed after
them: images gone, artist and posts alive, files unrecoverable.
Fix: delete the artist's post_attachment rows explicitly first, matched by
artist_id OR by the owning post's artist (artist_id is nullable, so neither
arm alone covers every row). `_repoint_post_links` already guards the
identical collision class in the reconcile path; this is its artist-cascade
counterpart. Migration 0043 reasoned only about upgrade-time safety and
never about this later SET NULL.
The sha-addressed blobs are deliberately left on disk: one blob backs many
rows, so unlinking needs a refcount pass, and this Tier-C op must not
delete bytes its own preview never disclosed.
Adds `attachments_deleted` to the summary, and two regression tests — the
same sha on two posts, and an unrelated NULL-post row that must survive.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com >
2026-08-26 22:02:51 -04:00
..
2026-07-03 09:36:54 -04:00
2026-05-14 07:32:17 -04:00
2026-07-02 23:21:52 -04:00
2026-07-02 11:20:45 -04:00
2026-07-03 08:40:11 -04:00
2026-06-12 13:05:58 -04:00
2026-06-01 14:17:52 -04:00
2026-07-04 22:04:20 -04:00
2026-06-03 15:45:59 -04:00
2026-05-28 11:33:05 -04:00
2026-06-26 11:47:48 -04:00
2026-06-29 12:54:35 -04:00
2026-06-04 16:55:20 -04:00
2026-06-17 12:03:48 -04:00
2026-05-30 00:59:05 -04:00
2026-05-28 11:33:05 -04:00
2026-07-04 22:37:50 -04:00
2026-06-23 01:11:42 -04:00
2026-07-05 19:42:59 -04:00
2026-06-28 10:36:25 -04:00
2026-05-28 11:33:05 -04:00
2026-07-06 22:59:00 -04:00
2026-05-28 12:43:08 -04:00
2026-07-10 22:38:25 -04:00
2026-06-01 14:17:52 -04:00
2026-06-11 23:10:30 -04:00
2026-06-14 15:57:42 -04:00
2026-07-10 22:38:25 -04:00
2026-05-28 11:33:05 -04:00
2026-05-30 23:15:07 -04:00
2026-06-17 12:03:48 -04:00
2026-07-10 15:22:51 -04:00
2026-06-10 11:34:42 -04:00
2026-05-28 11:33:05 -04:00
2026-06-30 13:04:31 -04:00
2026-06-30 13:47:55 -04:00
2026-05-28 11:33:05 -04:00
2026-07-06 18:51:39 -04:00
2026-06-01 21:57:29 -04:00
2026-06-06 14:33:24 -04:00
2026-06-16 20:30:31 -04:00
2026-07-04 22:04:20 -04:00
2026-06-01 14:17:52 -04:00
2026-06-03 15:45:59 -04:00
2026-05-19 11:11:07 -04:00
2026-05-26 01:18:38 -04:00
2026-05-26 01:18:07 -04:00
2026-05-19 14:59:04 -04:00
2026-06-01 22:09:02 -04:00
2026-06-10 14:29:17 -04:00
2026-06-26 11:47:48 -04:00
2026-07-06 16:21:38 -04:00
2026-06-16 21:05:26 -04:00
2026-06-24 00:06:49 -04:00
2026-07-06 18:59:00 -04:00
2026-05-21 16:02:36 -04:00
2026-05-26 08:13:53 -04:00
2026-08-26 22:02:51 -04:00
2026-06-02 17:04:27 -04:00
2026-07-02 21:51:51 -04:00
2026-06-29 10:17:05 -04:00
2026-06-09 23:46:01 -04:00
2026-07-03 09:54:18 -04:00
2026-06-30 13:41:25 -04:00
2026-07-03 10:00:14 -04:00
2026-06-06 21:22:32 -04:00
2026-05-28 12:43:08 -04:00
2026-07-13 17:50:07 -04:00
2026-05-15 13:53:42 -04:00
2026-06-16 21:15:49 -04:00
2026-07-02 16:53:08 -04:00
2026-05-29 15:34:20 -04:00
2026-05-20 20:39:17 -04:00
2026-06-03 22:58:46 -04:00
2026-06-17 12:03:48 -04:00
2026-06-04 07:01:07 -04:00
2026-06-03 23:50:19 -04:00
2026-07-12 23:15:59 -04:00
2026-07-13 12:06:22 -04:00
2026-07-02 16:53:08 -04:00
2026-07-02 21:07:21 -04:00
2026-07-06 18:18:46 -04:00
2026-07-06 16:36:30 -04:00
2026-06-29 00:36:58 -04:00
2026-07-06 18:28:25 -04:00
2026-05-28 11:33:05 -04:00
2026-07-06 23:34:18 -04:00
2026-06-14 16:39:58 -04:00
2026-05-19 11:14:49 -04:00
2026-06-21 22:22:03 -04:00
2026-05-18 21:33:55 -04:00
2026-06-15 22:17:36 -04:00
2026-05-25 20:33:44 -04:00
2026-05-25 22:16:26 -04:00
2026-06-01 14:40:28 -04:00
2026-06-01 14:17:52 -04:00
2026-07-02 17:37:21 -04:00
2026-07-09 16:17:56 -04:00
2026-06-14 13:15:36 -04:00
2026-07-07 22:15:33 -04:00
2026-05-26 21:23:12 -04:00
2026-06-30 13:41:25 -04:00
2026-05-15 15:48:29 -04:00
2026-06-01 14:17:52 -04:00
2026-06-01 14:17:52 -04:00
2026-05-19 11:10:53 -04:00
2026-05-20 12:53:34 -04:00
2026-05-20 18:32:52 -04:00
2026-05-20 18:33:14 -04:00
2026-05-20 20:36:19 -04:00
2026-06-12 13:05:58 -04:00
2026-06-30 13:04:31 -04:00
2026-07-13 21:41:24 -04:00
2026-05-15 07:36:17 -04:00
2026-07-10 15:22:51 -04:00
2026-06-03 13:00:08 -04:00
2026-05-14 07:34:29 -04:00
2026-06-07 18:34:11 -04:00
2026-06-14 16:39:58 -04:00
2026-06-17 11:32:28 -04:00
2026-06-15 00:14:52 -04:00
2026-06-17 11:32:28 -04:00
2026-07-06 14:15:19 -04:00
2026-07-04 22:37:50 -04:00
2026-06-05 19:26:57 -04:00
2026-06-30 13:04:31 -04:00
2026-05-17 22:18:07 -04:00
2026-07-04 22:24:25 -04:00
2026-07-03 19:41:29 -04:00
2026-07-03 09:45:14 -04:00
2026-06-17 12:03:48 -04:00
2026-05-20 18:34:02 -04:00
2026-07-07 12:31:46 -04:00
2026-07-12 23:15:59 -04:00
2026-07-06 23:46:09 -04:00
2026-07-13 10:14:38 -04:00
2026-06-15 00:14:52 -04:00
2026-06-21 22:22:03 -04:00
2026-07-13 12:06:22 -04:00
2026-07-13 21:41:34 -04:00
2026-07-02 16:53:08 -04:00
2026-06-29 11:18:28 -04:00
2026-07-06 18:13:37 -04:00
2026-06-06 14:33:24 -04:00
2026-05-25 22:16:26 -04:00
2026-05-19 11:14:49 -04:00
2026-05-30 12:08:43 -04:00
2026-06-11 21:30:01 -04:00
2026-06-11 23:17:14 -04:00
2026-06-11 21:47:58 -04:00
2026-06-07 18:58:18 -04:00
2026-06-11 21:30:01 -04:00
2026-06-11 23:10:30 -04:00
2026-06-11 23:10:30 -04:00
2026-05-15 15:49:25 -04:00
2026-07-04 20:13:53 -04:00
2026-06-14 16:39:58 -04:00
2026-05-14 12:04:05 -04:00
2026-07-04 22:15:38 -04:00
2026-07-04 22:37:50 -04:00
2026-06-28 11:20:11 -04:00
2026-07-03 08:34:16 -04:00
2026-06-26 00:51:56 -04:00
2026-06-30 13:04:31 -04:00
2026-06-06 23:57:06 -04:00
2026-05-26 21:00:12 -04:00
2026-07-06 19:03:51 -04:00
2026-05-15 07:39:33 -04:00
2026-06-06 17:39:54 -04:00
2026-05-24 21:22:42 -04:00
2026-06-16 08:31:50 -04:00
2026-06-10 14:29:17 -04:00
2026-06-07 00:08:19 -04:00
2026-07-02 16:53:08 -04:00
2026-05-27 22:45:11 -04:00
2026-05-21 18:53:35 -04:00
2026-05-14 12:05:19 -04:00
2026-05-21 16:01:59 -04:00
2026-07-02 23:19:41 -04:00
2026-07-10 22:38:25 -04:00
2026-07-10 22:38:25 -04:00
2026-05-19 18:15:59 -04:00
2026-07-13 10:14:38 -04:00
2026-07-13 10:14:38 -04:00