From 88f54d9a7699944b7d56f978e724b1c0b54dde98 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 19 Nov 2026 19:42:41 +0100 Subject: feat(sender): add bulk resend and delivery history Allow admins to resend all failed Webmentions globally or requeue every delivery for a source using the shared confirmation workflow. Record outgoing status history, expand sent source details, and provide human-readable guidance for current and historical delivery failures. --- .../templates/includes/failure_guidance.html | 26 ++ .../templates/includes/received_failure.html | 22 - webmentions_ssg/templates/received_detail.html | 2 +- webmentions_ssg/templates/sent.html | 22 +- webmentions_ssg/templates/sent_source.html | 442 ++++++++++++--------- 5 files changed, 304 insertions(+), 210 deletions(-) create mode 100644 webmentions_ssg/templates/includes/failure_guidance.html delete mode 100644 webmentions_ssg/templates/includes/received_failure.html (limited to 'webmentions_ssg/templates') diff --git a/webmentions_ssg/templates/includes/failure_guidance.html b/webmentions_ssg/templates/includes/failure_guidance.html new file mode 100644 index 0000000..9a36d89 --- /dev/null +++ b/webmentions_ssg/templates/includes/failure_guidance.html @@ -0,0 +1,26 @@ + + +{% macro render_failure(reason, direction="received") %} + {% if direction == "sent" %} + {% set guidance = reason | sent_failure_guidance %} + {% else %} + {% set guidance = reason | received_failure_guidance %} + {% endif %} + {% if guidance %} +
{{ guidance.explanation }}
+ {% if guidance.next_step %} +
Suggested next step: {{ guidance.next_step }}
+ {% endif %} +
+ Technical reason +
{{ reason }}
+
+ {% else %} +
{{ reason }}
+
Check the application logs for details before {{ 'resending' if direction == 'sent' else 'reverifying' }}.
+ {% endif %} +{% endmacro %} diff --git a/webmentions_ssg/templates/includes/received_failure.html b/webmentions_ssg/templates/includes/received_failure.html deleted file mode 100644 index 65ed7a3..0000000 --- a/webmentions_ssg/templates/includes/received_failure.html +++ /dev/null @@ -1,22 +0,0 @@ - - -{% macro render_failure(reason) %} - {% set guidance = reason | received_failure_guidance %} - {% if guidance %} -
{{ guidance.explanation }}
- {% if guidance.next_step %} -
Suggested next step: {{ guidance.next_step }}
- {% endif %} -
- Technical reason -
{{ reason }}
-
- {% else %} -
{{ reason }}
-
Check the application logs for details before reverifying.
- {% endif %} -{% endmacro %} diff --git a/webmentions_ssg/templates/received_detail.html b/webmentions_ssg/templates/received_detail.html index 38830bf..623ab73 100644 --- a/webmentions_ssg/templates/received_detail.html +++ b/webmentions_ssg/templates/received_detail.html @@ -5,7 +5,7 @@ SPDX-License-Identifier: BSD-3-Clause --> {% extends "base.html" %} -{% from "includes/received_failure.html" import render_failure %} +{% from "includes/failure_guidance.html" import render_failure %} {% set status_presentation = { "received": { "badge": "text-bg-info", diff --git a/webmentions_ssg/templates/sent.html b/webmentions_ssg/templates/sent.html index 9db0156..9dbbe8e 100644 --- a/webmentions_ssg/templates/sent.html +++ b/webmentions_ssg/templates/sent.html @@ -68,6 +68,18 @@ SPDX-License-Identifier: BSD-3-Clause class="btn btn-outline-secondary">Clear +
+ +
{% if sources.items %}
@@ -80,6 +92,7 @@ SPDX-License-Identifier: BSD-3-Clause {{ sortable_header('Revision', 'revision', 'd-none d-md-table-cell') }} {{ sortable_header('Created', 'created', 'd-none d-md-table-cell') }} {{ sortable_header('Last seen', 'last_seen', 'd-none d-md-table-cell') }} + @@ -98,9 +111,7 @@ SPDX-License-Identifier: BSD-3-Clause - + @@ -132,6 +143,11 @@ SPDX-License-Identifier: BSD-3-Clause {{ source.last_seen_at | relative_time }} + {% endfor %} diff --git a/webmentions_ssg/templates/sent_source.html b/webmentions_ssg/templates/sent_source.html index a24bde3..600934c 100644 --- a/webmentions_ssg/templates/sent_source.html +++ b/webmentions_ssg/templates/sent_source.html @@ -6,6 +6,7 @@ SPDX-License-Identifier: BSD-3-Clause {% extends "base.html" %} {% from "bootstrap5/pagination.html" import render_pagination %} +{% from "includes/failure_guidance.html" import render_failure %} {% set sent_status_presentation = { "sent": { "row_class": "table-success", @@ -28,204 +29,277 @@ SPDX-License-Identifier: BSD-3-Clause
← Back to Sent Webmentions
-
+

Sent Webmention Source

+ {% if source.deleted_at is none %} + Active + {% else %} + Deleted + {% endif %}
-
-
-
UUID
-
- {{ source.uuid }} -
-
Hash
-
- {{ source.content_hash }} -
-
Path
-
- {{ source.path }} -
-
URL
-
- {{ source.url }} -
-
Created at
-
- -
-
Last seen at
-
- -
-
Revised at
-
- -
-
Deleted at
-
- {% if source.deleted_at is none %} - N/A - {% else %} -
+
Last seen
+
+ +
+
Revised
+
+ +
+
Deleted
+
+ {% if source.deleted_at is none %} + Never + {% else %} + + {% endif %} +
+
Revision
+
+ {{ source.revision }} +
+
+
+ +
+
- {% if webmentions.items %} -
-
Details
{{ status_text }} - {{ source.path }} - {{ source.path }} {{ source.url }} + Details +
- - - - - - - - - - - - - {% for webmention in webmentions %} - {% set style = sent_status_presentation.get(webmention.status, {"row_class": "table-info", "badge_class": "text-bg-info", "label": "Pending" }) %} - - - - - - {% endfor %} - -
StatusTargetActiveRevisionsDeliveryLast activityActions
- {{ style.label }} - {% if webmention.failure_reason is not none %} -
{{ webmention.failure_reason }}
- {% endif %} - {% if webmention.awaiting_processing and webmention.attempt_count > 0 and webmention.next_retry_at is not none %} -
- Retry scheduled after attempt {{ webmention.attempt_count }}: - +
+
+

Sent Webmentions

+ {{ webmentions.total }} webmentions +
+ {% if webmentions.items %} +
+ + + + + + + + + + + + + + {% for webmention in webmentions %} + {% set style = sent_status_presentation.get(webmention.status, {"row_class": "table-info", "badge_class": "text-bg-info", "label": "Pending" }) %} + + + + + - - - - + + + + + {% endfor %} + +
StatusTargetActiveRevisionsDeliveryLast activityActions
+ {{ style.label }} + {% if webmention.failure_reason is not none %} +
{{ render_failure(webmention.failure_reason, "sent") }}
+ {% endif %} + {% if webmention.awaiting_processing and webmention.attempt_count > 0 and webmention.next_retry_at is not none %} +
+ Retry scheduled after attempt {{ webmention.attempt_count }}: + +
+ {% endif %} +
+ {{ webmention.target }} + + {% if webmention.linked %} + Active + {% else %} + Removed + {% endif %} + +
+ Desired: + {{ webmention.desired_revision }}
- {% endif %} -
- {{ webmention.target }} - - {% if webmention.linked %} - Active - {% else %} - Removed - {% endif %} - -
- Desired: - {{ webmention.desired_revision }} -
-
- Processed: - {{ webmention.processed_revision - if webmention.processed_revision is not none - else "—" }} -
-
- Sent: - {{ webmention.sent_revision - if webmention.sent_revision is not none - else "—" }} -
-
- {% if webmention.webmention_endpoint is not none %} -
- Endpoint: - {{ webmention.webmention_endpoint }} +
+ Processed: + {{ webmention.processed_revision + if webmention.processed_revision is not none + else "—" }}
- {% endif %} - {% if webmention.endpoint_response_status is not none %} +
+ Sent: + {{ webmention.sent_revision + if webmention.sent_revision is not none + else "—" }} +
+
+ {% if webmention.webmention_endpoint is not none %} + + {% endif %} + {% if webmention.endpoint_response_status is not none %} +
+ HTTP: + {{ webmention.endpoint_response_status }} +
+ {% endif %} + {% if webmention.status_url is not none %} +
+ Status: + {% if webmention.status_url | is_http_url %} + {{ webmention.status_url }} + {% else %} + {{ webmention.status_url }} + {% endif %} +
+ {% endif %} +
- HTTP: - {{ webmention.endpoint_response_status }} + Attempted: +
+ {% if webmention.last_attempted_at is not none %} + + {% else %} + — + {% endif %}
- {% endif %} - {% if webmention.status_url is not none %}
- Status: - {% if webmention.status_url | is_http_url %} - {{ webmention.status_url }} + Sent: +
+ {% if webmention.last_sent_at is not none %} + {% else %} - {{ webmention.status_url }} + — {% endif %}
+
+ +
+
+ {% if webmentions.pages > 1 %} +
{{ render_pagination(webmentions, args=dict(filters, source_page=source_page, history_page=history.page)) }}
+ {% endif %} + {% else %} +

No Webmentions have been discovered for this source.

+ {% endif %} +
+
+

Status history

+ {% if history.items %} +
    + {% for event in history.items %} + {% set style = sent_status_presentation.get(event.status, {"badge_class": "text-bg-info", "label": "Pending"}) %} +
  1. +
    +
    + {{ style.label }} + {{ event.action }} + +
    + +
    + Revision {{ event.revision }} · Attempt {{ event.attempt_count }} + {% if event.endpoint_response_status is not none %} + · HTTP {{ event.endpoint_response_status }} {% endif %} -
-
- Attempted: -
- {% if webmention.last_attempted_at is not none %} - - {% else %} - — - {% endif %} -
-
- Sent: -
- {% if webmention.last_sent_at is not none %} - - {% else %} - — - {% endif %} -
-
- -
-
- {% if webmentions.pages > 1 %} -
{{ render_pagination(webmentions, args=dict(filters, source_page=source_page)) }}
+ + {% if event.failure_reason %} +
{{ render_failure(event.failure_reason, "sent") }}
+ {% endif %} + + + {% endfor %} + + {% if history.pages > 1 %} +
+ {{ render_pagination( + history, + endpoint='webmentions.sent_source_history_pagination', + args=dict( + filters, + source_uuid=source.uuid, + source_page=source_page if source_page > 1 else none, + webmentions_page=webmentions.page if webmentions.page > 1 else none + ), + fragment='status-history-heading' + ) }} +
+ {% endif %} + {% else %} +

No historical delivery events were recorded for this source. Current Webmention statuses appear above.

{% endif %} - {% include "includes/confirmation_modal.html" %} - {% else %} -

No Webmentions have been discovered for this source.

- {% endif %} + + {% include "includes/confirmation_modal.html" %} {% endblock %} {% block scripts %} -- cgit v1.3.1