Article cleanup and retention policy #89

Closed
opened 2026-03-09 00:05:23 +01:00 by myrmidex · 0 comments
Owner

Summary

Add a scheduled cleanup mechanism for old and rejected articles to prevent unbounded database growth.

Context

Rejected and old published articles accumulate indefinitely. With automated posting enabled, this will grow faster. Need a retention policy and cleanup job.

Architecture note (post #85)

  • route_articles records are cascade-deleted when their parent article is deleted, so cleaning up articles automatically cleans up route_articles too
  • However, consider whether rejected route_articles should have a shorter retention than their parent article (e.g. article stays but rejected route_articles are pruned)

Tasks

  • Add retention settings (e.g. article_retention_days for published, rejected_retention_days for rejected)
  • Scheduled job to delete articles older than retention threshold
  • Consider route_article-level retention (prune rejected route_articles independently)
  • Preserve articles with active route_articles (pending/approved) — only delete when all route_articles are resolved
  • Settings UI for retention configuration
  • Tests for cleanup logic and edge cases (e.g. article with error status, article mid-publish)
## Summary Add a scheduled cleanup mechanism for old and rejected articles to prevent unbounded database growth. ## Context Rejected and old published articles accumulate indefinitely. With automated posting enabled, this will grow faster. Need a retention policy and cleanup job. ## Architecture note (post #85) - `route_articles` records are cascade-deleted when their parent article is deleted, so cleaning up articles automatically cleans up route_articles too - However, consider whether rejected `route_articles` should have a shorter retention than their parent article (e.g. article stays but rejected route_articles are pruned) ## Tasks - [ ] Add retention settings (e.g. `article_retention_days` for published, `rejected_retention_days` for rejected) - [ ] Scheduled job to delete articles older than retention threshold - [ ] Consider route_article-level retention (prune rejected route_articles independently) - [ ] Preserve articles with active route_articles (pending/approved) — only delete when all route_articles are resolved - [ ] Settings UI for retention configuration - [ ] Tests for cleanup logic and edge cases (e.g. article with error status, article mid-publish)
myrmidex added this to the v1.3.0 milestone 2026-03-09 00:05:23 +01:00
myrmidex added the
enhancement
label 2026-03-09 00:24:20 +01:00
myrmidex self-assigned this 2026-03-18 17:54:00 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lvl0/fedi-feed-router#89
No description provided.