From 55f418ac624ffc4ad5d5d388e7a54fb362055913 Mon Sep 17 00:00:00 2001 From: kmaclip Date: Fri, 27 Mar 2026 14:18:49 -0400 Subject: [PATCH] fix: use nonempty() for retry array type to match runtime validation The Zod schema enforces .min(1).max(10) on the retry array, but .min() does not change the inferred TypeScript type. This means the type allows empty arrays while the runtime rejects them with "body/retry must NOT have fewer than 1 items". Replace .min(1) with .nonempty() which both enforces the minimum at runtime AND narrows the inferred type to require at least one element, aligning the TypeScript type with the runtime behavior. Closes #1167 --- src/client/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/index.ts b/src/client/index.ts index cc964b621..842432c5b 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -129,7 +129,7 @@ const EnqueueJobOptionsSchema = z.object({ id: z.string().optional(), exclusive: z.boolean().optional(), override: z.boolean().optional(), - retry: z.array(timeDuration("retry")).min(1).max(10).optional(), + retry: z.array(timeDuration("retry")).nonempty().max(10).optional(), delay: timeDuration("delay").optional(), runAt: z .date()