Private
Public Access
Stop retention from bringing deleted articles back (#29)
The nightly purge deleted articles, but a feed that still listed an entry would re-insert it on its next poll as a brand-new, unread article. For feeds with long archives, old items could reappear after every retention run. The purge now leaves a (feed, guid) tombstone per deleted article, and ingestion skips tombstoned guids. With retention on, entries whose own publish date is already outside the window are not ingested at all, so a long archive isn't fetched only to be purged and tombstoned the same night. Undated entries rely on the tombstone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
73dbee9400
commit
f8cd1eb33e
6 files changed
+156
-5
No files matched your search
@@ -72,3 +72,20 @@ def test_purge_works_through_more_than_one_chunk(feed, monkeypatch):
|
||||
|
||||
assert purge_old_articles() == 5
|
||||
assert Article.objects.count() == 0
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_purge_leaves_a_tombstone_per_deleted_article(feed):
|
||||
from .models import PurgedArticle
|
||||
|
||||
SiteSettings.objects.create(retention_days=30)
|
||||
_article(feed, "gone-1", age_days=60)
|
||||
_article(feed, "gone-2", age_days=60)
|
||||
_article(feed, "kept", age_days=1)
|
||||
|
||||
purge_old_articles()
|
||||
|
||||
assert set(PurgedArticle.objects.filter(feed=feed).values_list("guid", flat=True)) == {
|
||||
"gone-1",
|
||||
"gone-2",
|
||||
}
|
||||
Reference in new issue
Block a user