From bea26a3abda76c2cad4cab0584ebefa9c757fb85 Mon Sep 17 00:00:00 2001 From: Zimeng Xiong Date: Tue, 20 Jan 2026 09:37:14 -0800 Subject: [PATCH] fix: support both legacy and current currentItemRoundness formats Add union type to accept both the old object format {type, value} and the new enum format for backwards compatibility with existing drawings. --- backend/src/security.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/src/security.ts b/backend/src/security.ts index 1794c3c..8696b11 100644 --- a/backend/src/security.ts +++ b/backend/src/security.ts @@ -319,7 +319,16 @@ export const appStateSchema = z .enum(["solid", "dashed", "dotted"]) .optional() .nullable(), - currentItemRoundness: z.enum(["sharp", "round"]).optional().nullable(), + currentItemRoundness: z + .union([ + z.enum(["sharp", "round"]), + z.object({ + type: z.enum(["round", "sharp"]), + value: z.number().finite().min(0).max(1), + }), + ]) + .optional() + .nullable(), currentItemFontSize: z .number() .finite()