fix(cron): validate webhook mode requires URL in resolveFailureDestination

When mode is 'webhook' but no 'to' URL is provided, return null
instead of creating an invalid plan that silently fails later.
This commit is contained in:
Evgeny Zislis
2026-03-02 01:54:48 +02:00
committed by Tak Hoffman
parent 099f3c7341
commit 386a60e77d

View File

@@ -156,6 +156,12 @@ export function resolveFailureDestination(
}
const resolvedMode = mode ?? "announce";
// Webhook mode requires a URL
if (resolvedMode === "webhook" && !to) {
return null;
}
const result: CronFailureDeliveryPlan = {
mode: resolvedMode,
channel: resolvedMode === "announce" ? (channel ?? "last") : undefined,