From 8fd569c6c0a39761f7ddda3c6e145d90534b4300 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 30 Oct 2026 20:13:42 +0100 Subject: fix(receiver): recover stale Webmention verifications Add a periodic recovery sweep for Webmentions left in received or verifying states after worker crashes, lost queue entries, or interrupted processing. Use atomic lease-style updates so stale workers cannot overwrite newer results, and index verification state for efficient recovery scans. --- tests/cli/test_database.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/cli') diff --git a/tests/cli/test_database.py b/tests/cli/test_database.py index f25aade..1c36d1f 100644 --- a/tests/cli/test_database.py +++ b/tests/cli/test_database.py @@ -82,9 +82,15 @@ def test_create_db_builds_schema_and_records_latest_migration( with database_app.app_context(): inspector = inspect(DATABASE.engine) table_names = set(inspector.get_table_names()) - columns = {column["name"] for column in inspector.get_columns("sent_webmentions")} + columns = { + column["name"] for column in inspector.get_columns("sent_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 "ix_received_webmentions_status_updated_at" in received_indexes def test_create_db_refuses_existing_database_without_modifying_it( -- cgit v1.3.1