aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/tasks/receiver.py
diff options
context:
space:
mode:
authorDennis Fink2026-10-29 20:59:48 +0100
committerDennis Fink2026-10-29 20:59:48 +0100
commitedd7c0c2220ba12c2a773f9ba1cf6e0e7a273856 (patch)
treec067d16841e3d3441e3b4c6f7ed833a6d57fae04 /webmentions_ssg/tasks/receiver.py
parent9a1e863079b64883beadaba7b283621f1b3cf70a (diff)
downloadwebmentions-ssg-edd7c0c2220ba12c2a773f9ba1cf6e0e7a273856.tar.gz
webmentions-ssg-edd7c0c2220ba12c2a773f9ba1cf6e0e7a273856.zip
feat(receiver): send Webmention notification digests
Batch verified Webmention notifications into a scheduled digest so bursts of incoming mentions do not generate a separate email for every verification. Track which mentions have already been reported and leave them pending when SMTP delivery fails so a later digest can retry safely.
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/tasks/receiver.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/webmentions_ssg/tasks/receiver.py b/webmentions_ssg/tasks/receiver.py
index 0b7743d..2bb7222 100644
--- a/webmentions_ssg/tasks/receiver.py
+++ b/webmentions_ssg/tasks/receiver.py
@@ -17,7 +17,6 @@ from .. import DATABASE as db
from .. import HUEY as huey
from ..models import ReceivedWebmention
from ..url_security import AddressResolutionError, is_public_url
-from .notifications import send_webmention_notification
class VerificationError(Exception):
@@ -217,9 +216,7 @@ def source_mentions_target(source_url: str, target_url: str) -> bool:
@huey.task(retries=2, retry_delay=50)
-def verify_webmention(
- webmention_uuid: uuid.UUID, send_notification: bool = True
-) -> None:
+def verify_webmention(webmention_uuid: uuid.UUID) -> None:
"""
Verify a received webmention and store its verification status.
@@ -227,8 +224,6 @@ def verify_webmention(
retry the task.
:param webmention_uuid: Identifier of the received webmention to verify.
- :param send_notification: Whether to enqueue an email notification after
- successful verification.
:raises TemporaryFetchError: If fetching the source fails temporarily.
:raises httpx.RequestError: If an HTTP request error occurs while fetching
the source.
@@ -270,12 +265,3 @@ def verify_webmention(
webmention.failure_reason = "Source does not mention target"
db.session.commit()
-
- if send_notification:
- try:
- send_webmention_notification(webmention_uuid)
- except Exception:
- # Notification delivery must not change the persisted verification status.
- current_app.logger.exception(
- "Could not enqueue webmention notification for %s", webmention_uuid
- )