From df3b79e2c89978ec21dc2da7f90801dce33aeab2 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sat, 31 Oct 2026 19:00:17 +0100 Subject: fix(receiver): prevent endless verification recovery Cap stale verification requeues so repeatedly lost or crashing tasks eventually become terminal failures instead of cycling indefinitely. Reject URLs that httpx cannot safely fetch before enqueueing, and persist unexpected verification errors as terminal failures. --- tests/cli/test_database.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/cli/test_database.py') diff --git a/tests/cli/test_database.py b/tests/cli/test_database.py index 7095d51..7d325aa 100644 --- a/tests/cli/test_database.py +++ b/tests/cli/test_database.py @@ -85,11 +85,15 @@ def test_create_db_builds_schema_and_records_latest_migration( columns = { column["name"] for column in inspector.get_columns("sent_webmentions") } + received_columns = { + column["name"] for column in inspector.get_columns("received_webmentions") + } received_indexes = { index["name"] for index in inspector.get_indexes("received_webmentions") } assert {"alembic_version", "users", "received_webmentions"} <= table_names assert {"attempt_count", "next_retry_at"} <= columns + assert "recovery_attempts" in received_columns assert "ix_received_webmentions_status_updated_at" in received_indexes @@ -247,6 +251,10 @@ def test_upgrade_backfills_portable_digest_for_existing_received_rows( ) ).one() assert result.status == "verified" + recovery_attempts = connection.execute( + sa.text("SELECT recovery_attempts FROM received_webmentions") + ).scalar_one() + assert recovery_attempts == 0 assert result.url_digest == received_url_digest( result.source, result.target ) -- cgit v1.3.1