aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/scanner.py
diff options
context:
space:
mode:
authorDennis Fink2026-11-21 14:49:28 +0100
committerDennis Fink2026-11-21 14:49:28 +0100
commitef90dc381322122ecfb9af039cf790de92807514 (patch)
tree9b81d9726b05fbd22e738bbc29ab6ec66536c11f /webmentions_ssg/tasks/scanner.py
parenteb11fb64e9cad6fbda2065362189653416d98577 (diff)
downloadwebmentions-ssg-ef90dc381322122ecfb9af039cf790de92807514.tar.gz
webmentions-ssg-ef90dc381322122ecfb9af039cf790de92807514.zip
feat(sender): split source and delivery history
Add per-Webmention detail pages so delivery state, failure guidance, status URLs, and delivery history no longer crowd the source overview. Track source lifecycle events separately for discovery, revision, deletion, and restoration, and add a source-level action to resend only failed Webmentions.
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/tasks/scanner.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/webmentions_ssg/tasks/scanner.py b/webmentions_ssg/tasks/scanner.py
index 9058b9b..6d4045e 100644
--- a/webmentions_ssg/tasks/scanner.py
+++ b/webmentions_ssg/tasks/scanner.py
@@ -49,6 +49,8 @@ def build_source(scanned: ScannedSource, scan_time: datetime) -> SourceDocument:
deleted_at=None,
)
+ source.record_event("Discovered", at=scan_time)
+
for target in scanned.targets:
source.sent_webmentions.append(
SentWebmention(target=target, linked=True, desired_revision=1)
@@ -83,10 +85,12 @@ def apply_scan_to_source(
if source.deleted_at is None and source.content_hash == scanned.content_hash:
return source
+ restored = source.deleted_at is not None
source.revision += 1
source.content_hash = scanned.content_hash
source.revised_at = scan_time
source.deleted_at = None
+ source.record_event("Restored" if restored else "Revised", at=scan_time)
existing = {webmention.target: webmention for webmention in source.sent_webmentions}
@@ -219,6 +223,7 @@ def mark_missing_sources_deleted(
source.revision += 1
source.revised_at = scan_time
source.deleted_at = scan_time
+ source.record_event("Deleted", at=scan_time)
marked += 1
for webmention in source.sent_webmentions: