From f6d96df2c3aecb51ca97426efddb101dce6350d7 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 30 Oct 2026 13:24:53 +0100 Subject: feat(sender): add persistent retry backoff Persist retry state per source revision so temporary delivery failures survive worker restarts and duplicate queued tasks cannot bypass the retry schedule. Use capped exponential backoff, stop after a configurable attempt limit, and reset the retry budget when a source changes or an admin resends manually. --- tests/test_views.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/test_views.py') diff --git a/tests/test_views.py b/tests/test_views.py index 8ac57b1..fb12b8b 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -693,6 +693,13 @@ def test_resend_sent_webmention_reopens_current_revision( send_webmention = Mock() monkeypatch.setattr(views_module, "send_webmention", send_webmention) + with app.app_context(): + webmention = db.session.get(SentWebmention, webmention_identifier) + assert webmention is not None + webmention.attempt_count = 6 + webmention.next_retry_at = datetime.now(UTC) + timedelta(hours=24) + db.session.commit() + response = client.post(f"/sent/{source_identifier}/{webmention_identifier}/resend") assert response.status_code == 302 @@ -703,6 +710,8 @@ def test_resend_sent_webmention_reopens_current_revision( assert webmention is not None assert webmention.desired_revision == 3 assert webmention.processed_revision is None + assert webmention.attempt_count == 0 + assert webmention.next_retry_at is None assert webmention.sent_revision == 2 assert webmention.status is None assert webmention.failure_reason is None -- cgit v1.3.1