From d6900fcbb40d0c7fb717131014d8ceaa37383cb3 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Tue, 27 Oct 2026 14:30:10 +0800 Subject: [PATCH] fix(cli): send queue maxRetries and retryDelay on managed deploys A queue file could set `export const maxRetries = 0` or `export const retryDelay = 30`, but a Void-managed `void deploy` left both out of the deploy manifest. The platform then created the queue consumer with Cloudflare's defaults (3 retries, no delay), so consumers that asked for no retries were still retried. The managed manifest now includes both options when they are set, keeping 0 as a real value, the same as native Cloudflare deploys. Co-Authored-By: Claude Opus 5.5 --- packages/void/src/cli/deploy-helpers.ts | 2 ++ .../void/test/unit/deploy-project.test.ts | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/packages/void/src/cli/deploy-helpers.ts b/packages/void/src/cli/deploy-helpers.ts index 493719edf..81b9df40b 100644 --- a/packages/void/src/cli/deploy-helpers.ts +++ b/packages/void/src/cli/deploy-helpers.ts @@ -539,6 +539,8 @@ export function toManifestSchedulesAndQueues( bindingName: q.bindingName, ...(q.maxBatchSize != null && { maxBatchSize: q.maxBatchSize }), ...(q.maxBatchTimeout != null && { maxBatchTimeout: q.maxBatchTimeout }), + ...(q.maxRetries != null && { maxRetries: q.maxRetries }), + ...(q.retryDelay != null && { retryDelay: q.retryDelay }), })), }; } diff --git a/packages/void/test/unit/deploy-project.test.ts b/packages/void/test/unit/deploy-project.test.ts index 0fb5cab3b..028b263aa 100644 --- a/packages/void/test/unit/deploy-project.test.ts +++ b/packages/void/test/unit/deploy-project.test.ts @@ -14,6 +14,7 @@ import { resolveFullDeployBuildCommand, resolveStaticDeployPreset, resolveStaticBuildCommand, + toManifestSchedulesAndQueues, } from '../../src/cli/deploy-helpers.ts'; import { formatProjectCommand, @@ -557,3 +558,35 @@ describe('generateDeployWrapperIfNeeded', () => { expect(handler).toContain('VALUES ($1, $2)'); }); }); + +describe('toManifestSchedulesAndQueues', () => { + it('keeps queue retry options, including zero', () => { + const { queues } = toManifestSchedulesAndQueues( + [], + [ + { + filePath: 'emails.ts', + name: 'emails', + bindingName: 'QUEUE_EMAILS', + maxBatchSize: 50, + maxBatchTimeout: 10, + maxRetries: 0, + retryDelay: 30, + }, + { filePath: 'jobs.ts', name: 'jobs', bindingName: 'QUEUE_JOBS' }, + ], + ); + expect(queues).toEqual([ + { + name: 'emails', + bindingName: 'QUEUE_EMAILS', + maxBatchSize: 50, + maxBatchTimeout: 10, + maxRetries: 0, + retryDelay: 30, + }, + { name: 'jobs', bindingName: 'QUEUE_JOBS' }, + ]); + expect(Object.keys(queues[1]!)).toEqual(['name', 'bindingName']); + }); +});