fix(webui): harden automation management API

Maintainer edit: redact external channel chat identifiers from the WebUI automation payload and reject malformed or unschedulable automation updates before they mutate cron jobs.
This commit is contained in:
chengyongru
2026-06-14 22:19:28 +08:00
parent 747f0a08c7
commit 8b42d0760e
6 changed files with 107 additions and 33 deletions
@@ -3583,7 +3583,7 @@ function AutomationRow({
t(key, { defaultValue: fallback, ...(values ?? {}) });
const status = automationStatus(job, tx);
const origin = automationOriginLabel(job, tx);
const originHref = job.origin?.channel === "websocket"
const originHref = job.origin?.channel === "websocket" && job.origin.session_key
? `#/chat/${encodeURIComponent(job.origin.session_key)}`
: null;
const history = job.state.run_history ?? [];
@@ -4257,7 +4257,7 @@ function automationOriginLabel(
}
if (!origin) return tx("settings.automations.origin.unknown", "No linked chat");
if (origin.channel !== "websocket") return automationChannelLabel(origin.channel, tx);
return origin.title || origin.preview || origin.session_key;
return origin.title || origin.preview || origin.session_key || automationChannelLabel(origin.channel, tx);
}
function automationChannelLabel(