Skip to content

Commit 65aceb5

Browse files
committed
fix(webapp): honor the webhook kill switch in test send, fix duplicate id and pager refresh
Three dashboard fixes: The test-send action now returns early when WEBHOOK_ENABLED is off, matching the ingress route, so a test send cannot record a delivery the disabled engine would never process (no partition, no worker). The duplicate outcome no longer re-prefixes the delivery id (it is already a friendlyId), so the console shows a valid id and a working "view original" link instead of a whd_whd_ id. The "new deliveries" button now clears the deliveriesCursor/deliveriesDirection params this page actually paginates on, so it shows the new rows past page one.
1 parent 207fa9b commit 65aceb5

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.webhooks.$webhookParam/route.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,10 @@ function LiveDeliveriesTable({
521521

522522
const onClickShowNewDeliveries = () => {
523523
dismissNewDeliveries();
524-
if (searchParams.has("cursor") || searchParams.has("direction")) {
524+
if (searchParams.has("deliveriesCursor") || searchParams.has("deliveriesDirection")) {
525525
setSearchParams((prev) => {
526-
prev.delete("cursor");
527-
prev.delete("direction");
526+
prev.delete("deliveriesCursor");
527+
prev.delete("deliveriesDirection");
528528
return prev;
529529
});
530530
return;

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.webhooks.endpoints.$endpointParam.send.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export async function action({ request, params }: ActionFunctionArgs): Promise<W
5050
const user = await requireUser(request);
5151
const { organizationSlug, projectParam, envParam, endpointParam } = ParamsSchema.parse(params);
5252

53+
if (env.WEBHOOK_ENABLED !== "1") {
54+
return { success: false, error: "Webhooks are not enabled on this instance." };
55+
}
56+
5357
const project = await findProjectBySlug(organizationSlug, projectParam, user.id);
5458
if (!project) return { success: false, error: "Project not found" };
5559
const environment = await findEnvironmentBySlug(project.id, envParam, user.id);
@@ -189,7 +193,7 @@ export async function action({ request, params }: ActionFunctionArgs): Promise<W
189193
case "handshake":
190194
return { success: true, httpStatus: 200, handshake: true, responseBody: result.body };
191195
case "duplicate": {
192-
const friendlyId = `whd_${result.deliveryId}`;
196+
const friendlyId = result.deliveryId;
193197
if (shouldRedirect) throw redirect(deliveryPathFor(friendlyId));
194198
return {
195199
success: true,

0 commit comments

Comments
 (0)