diff options
| author | Dennis Fink | 2026-10-31 19:00:17 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-10-31 19:00:17 +0100 |
| commit | df3b79e2c89978ec21dc2da7f90801dce33aeab2 (patch) | |
| tree | 146f34d59b2b1957e53856a58777a3453960a2a5 /tests/cli | |
| parent | f7c0691e0da84644ea8b2b83ad5574fe179da59b (diff) | |
| download | webmentions-ssg-df3b79e2c89978ec21dc2da7f90801dce33aeab2.tar.gz webmentions-ssg-df3b79e2c89978ec21dc2da7f90801dce33aeab2.zip | |
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.
Diffstat (limited to '')
| -rw-r--r-- | tests/cli/test_database.py | 8 |
1 files changed, 8 insertions, 0 deletions
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 ) |
