From b9713f45fca54e0e3077ecb78f22eaac521da46f Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 31 May 2025 20:57:23 +0000 Subject: [PATCH] fix: possible fix to log format validation --- backend/src/plugins/Logs/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/plugins/Logs/types.ts b/backend/src/plugins/Logs/types.ts index 90de0d80..0ce8ad52 100644 --- a/backend/src/plugins/Logs/types.ts +++ b/backend/src/plugins/Logs/types.ts @@ -30,7 +30,7 @@ const MAX_BATCH_TIME = 5000; // A bit of a workaround so we can pass LogType keys to z.enum() const logTypes = keys(LogType); const logTypeProps = logTypes.reduce((map, type) => { - map[type] = zMessageContent; + map[type] = zMessageContent.default(DefaultLogMessages[type] || ""); return map; }, {} as Record); const zLogFormats = z.strictObject(logTypeProps); @@ -58,7 +58,7 @@ export type TLogChannelMap = z.infer; export const zLogsConfig = z.strictObject({ channels: zLogChannelMap.default({}), - format: zLogFormats.default(DefaultLogMessages), + format: zLogFormats, // Legacy/deprecated, if below is false mentions wont actually ping. In case you really want the old behavior, set below to true ping_user: z.boolean().default(true), allow_user_mentions: z.boolean().default(false),