From 9180954903d52be6fbb0de0dccdc53a8512df372 Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Sat, 21 Mar 2026 23:21:58 -0700 Subject: [PATCH] fix(platform+admin-web): 3 bugs in delivery retry + webhooks delivery loading Backend (delivery retry): - Use NotFoundError (404) instead of BadRequestError (400) for missing log doc - Add telegram + slack retry support (was email-only, threw error for others) Frontend (delivery page): - Add pk field to DeliveryEntry interface - Pass pk query param in retry call so backend can look up the doc - Fix handleRetry to accept full entry object instead of just id Frontend (webhooks page): - Parallelize delivery fetches with Promise.allSettled (was sequential for loop) - Significant page load improvement for subscriptions with many deliveries --- .../src/app/(dashboard)/delivery/page.tsx | 9 ++++-- .../src/app/(dashboard)/webhooks/page.tsx | 31 ++++++++++--------- .../src/modules/delivery/routes.ts | 24 ++++++++++++-- 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/dashboards/admin-web/src/app/(dashboard)/delivery/page.tsx b/dashboards/admin-web/src/app/(dashboard)/delivery/page.tsx index 48ba094e..0af8e249 100644 --- a/dashboards/admin-web/src/app/(dashboard)/delivery/page.tsx +++ b/dashboards/admin-web/src/app/(dashboard)/delivery/page.tsx @@ -24,6 +24,7 @@ import { interface DeliveryEntry { id: string; + pk: string; template: string; recipient: string; channel: string; @@ -71,8 +72,10 @@ export default function DeliveryPage() { void loadData(); }, [loadData]); - async function handleRetry(id: string) { - await apiFetch(`logs/${id}/retry`, { method: 'POST' }); + async function handleRetry(entry: DeliveryEntry) { + await apiFetch(`logs/${entry.id}/retry?pk=${encodeURIComponent(entry.pk)}`, { + method: 'POST', + }); loadData(); } @@ -191,7 +194,7 @@ export default function DeliveryPage() { {e.status === 'failed' && (