diff options
| author | Dennis Fink | 2026-10-30 13:24:53 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-30 13:24:53 +0100 |
| commit | f6d96df2c3aecb51ca97426efddb101dce6350d7 (patch) | |
| tree | 2968f65a627fbfd15051277d07eaa321db0e3cc4 /tests/test_views.py | |
| parent | 2b59a3082000842d980f9e19931949dbe5011229 (diff) | |
| download | webmentions-ssg-f6d96df2c3aecb51ca97426efddb101dce6350d7.tar.gz webmentions-ssg-f6d96df2c3aecb51ca97426efddb101dce6350d7.zip | |
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.
Diffstat (limited to 'tests/test_views.py')
| -rw-r--r-- | tests/test_views.py | 9 |
1 files changed, 9 insertions, 0 deletions
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 |
