Surgical re-fetch for deep posts (ExternalLink reset) — recovery no longer needs deep scans #189

Merged
bvandeusen merged 1 commits from dev into main 2026-07-02 21:14:46 -04:00
Owner

One CI-green commit (run 1882):

  • aa12a57 surgical re-fetch: refetch_links_for_post resets 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_image now does this automatically (captures post ids pre-delete); new POST /api/admin/posts/refetch-external is 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

One CI-green commit (run 1882): - `aa12a57` **surgical re-fetch**: `refetch_links_for_post` resets 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_image` now does this automatically (captures post ids pre-delete); new `POST /api/admin/posts/refetch-external` is 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.com/claude-code) https://claude.ai/code/session_01CDgx8bQS5YrGRK76v8HUnM
bvandeusen added 1 commit 2026-07-02 21:14:38 -04:00
feat(recovery): surgical re-fetch for deep posts via ExternalLink reset
CI / lint (push) Successful in 5s
CI / frontend-build (push) Successful in 47s
CI / backend-lint-and-test (push) Successful in 2m0s
CI / integration (push) Successful in 4m50s
aa12a57f97
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
bvandeusen merged commit e3ceefc820 into main 2026-07-02 21:14:46 -04:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bvandeusen/FabledCurator#189