From be6cbe7839660beb22b41092bcdb09bdd2c3ee13 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <209825114+claude[bot]@users.noreply.github.com> Date: Sun, 1 Jun 2025 19:44:41 +0200 Subject: [PATCH] fix: replace crypto.randomUUID with generateRandomString for HTTP compatibility (#5849) Replace crypto.randomUUID() with generateRandomString() in triggers.svelte.ts to fix schedule trigger creation on HTTP connections. The crypto.randomUUID() API requires a secure context (HTTPS), which breaks functionality for users connecting to Windmill over HTTP in internal networks. Fixes #5847 Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: rubenfiszel --- frontend/src/lib/components/triggers/triggers.svelte.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/triggers/triggers.svelte.ts b/frontend/src/lib/components/triggers/triggers.svelte.ts index 5f40fb6126..916d4202fe 100644 --- a/frontend/src/lib/components/triggers/triggers.svelte.ts +++ b/frontend/src/lib/components/triggers/triggers.svelte.ts @@ -20,7 +20,7 @@ import type { Writable } from 'svelte/store' import type { TriggerType } from './utils' import type { UserExt } from '$lib/stores' import type { ScheduleTrigger } from '../triggers' -import { canWrite, formatCron } from '$lib/utils' +import { canWrite, formatCron, generateRandomString } from '$lib/utils' export class Triggers { #triggers = $state([]) @@ -94,7 +94,7 @@ export class Triggers { const primaryScheduleExists = this.#triggers.some((t) => t.type === 'schedule' && t.isPrimary) // Create the new draft trigger - const draftId = crypto.randomUUID() + const draftId = generateRandomString() const isPrimary = type === 'schedule' && !primaryScheduleExists const newTrigger = { id: draftId,