From 616d262e99df3c1472676c8a3ff8eb54cd3157d3 Mon Sep 17 00:00:00 2001 From: Quick <31828688+Quick104@users.noreply.github.com> Date: Wed, 29 Jul 2026 17:01:53 +0000 Subject: [PATCH] fix(autoscan): keep the add dialog open when webhook generation fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by adversarial review of this branch's own diff. A webhook source is created enabled and its endpoint generated in a second request. If that second request failed the dialog closed, leaving an enabled webhook source with no endpoint — it could never receive a delivery, and nothing on screen said why. Hold the created source instead and render a retry, so the failure is visible and recoverable without hunting for the source on the row. --- web/src/pages/admin/autoscan/SourcesPanel.tsx | 43 ++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/web/src/pages/admin/autoscan/SourcesPanel.tsx b/web/src/pages/admin/autoscan/SourcesPanel.tsx index 094697d1..fe73eb7d 100644 --- a/web/src/pages/admin/autoscan/SourcesPanel.tsx +++ b/web/src/pages/admin/autoscan/SourcesPanel.tsx @@ -1323,9 +1323,15 @@ function AddSourceDialog({ // Generate the endpoint immediately and stay open: the operator still // needs the URL, and closing here is what previously left them to // hunt for a "Generate webhook URL" button on the row. + // + // On failure, stay open holding the created source rather than + // closing. The source exists and is enabled at this point, so + // dismissing the dialog would leave an enabled webhook source with no + // endpoint and no visible explanation. The instructions panel renders + // a retry when the URL is missing. createWebhook.mutate(created.id, { onSuccess: (withWebhook) => setCreatedWebhookSource(withWebhook), - onError: close, + onError: () => setCreatedWebhookSource(created), }); }, }, @@ -1365,10 +1371,37 @@ function AddSourceDialog({ {createdWebhookSource ? (
+
+ The source was created, but has no endpoint yet — it can't receive anything + until one exists. +
+ +Loading available sources…