Surgical re-fetch for deep posts (ExternalLink reset) — recovery no longer needs deep scans #189
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One CI-green commit (run 1882):
aa12a57surgical re-fetch:refetch_links_for_postresets a post's settled ExternalLink rows (fresh attempt budget) and dispatches their fetches — sha-dedupe discards what still exists, only missing files land.recover_defective_imagenow does this automatically (captures post ids pre-delete); newPOST /api/admin/posts/refetch-externalis the manual tool for the three files recovered before this existed. Deep back-catalogue posts no longer require artist-wide deep scans to restore a deleted file.Backend-only; no migrations. Curator redeploy required to use the endpoint.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CDgx8bQS5YrGRK76v8HUnM
Operator-flagged: the recovered defective files live DEEP in their artists' back-catalogues — the normal download cadence (by design, via the seen-gates) will never re-walk them, so recovery's source re-check alone can't bring them back. The durable per-post handle is the ExternalLink row, which survives the image delete: - services/external_links.refetch_links_for_post: reset settled links to pending (fresh attempt budget, in-flight left alone) + dispatch their fetches; sha-dedupe at import discards payload files that still exist, so only the missing file lands. - recover_defective_image now captures the image's post ids BEFORE the delete cascades provenance away and resets those posts' links — future recoveries are surgical automatically (response gains links_reset; source re-check stays for gallery-dl-native files within walk reach). - POST /api/admin/posts/refetch-external {external_post_id, source_id?} — the manual tool for the three files recovered before this fix existed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CDgx8bQS5YrGRK76v8HUnM