#10286 [Breaking] Remove delivery_delay parameter from queue producer binding
Partially fixed by PR #10288 (wrangler 4.29.0) which removed putQueue call. However, delivery_delay parameter still exists in schema - it is now a silent no-op. Issue requests full removal as breaking change.
Complete the breaking change: remove delivery_delay from producer schema or add deprecation warning.
Analysis Report
Issue Review: cloudflare/workers-sdk#10286
Summary
Request to remove delivery_delay parameter from queue producer binding configuration as a breaking change, since workers should not affect queue-level settings.
Findings
- Created: 2025-08-08
- Updated: 2025-08-11
- Version: wrangler 4.28.1 -> 4.60.0 (current)
- Component: wrangler (queues)
- Labels: bug, breaking change
- Comments: 0
Key Evidence
PR #10288 merged on 2025-08-11 - "fix(wrangler) remove putQueue call when deploying a worker with queue producer binding"
- This PR removed the
updateQueueProducersfunction that was callingputQueueAPI - Fixes the behavioral issue: workers no longer affect queue-level settings during deployment
- Released in wrangler 4.29.0
- This PR removed the
Partial fix only - The
delivery_delayparameter is still present in the schema:- File:
packages/workers-utils/src/config/environment.ts - The parameter is now a no-op but still accepted without warning
- PR #10288 notes: "(optionally start deprecating 'delivery_delay' as now, setting it will not do anything)"
- File:
Issue title explicitly requests breaking change - "[Breaking] Remove delivery_delay parameter from queue producer binding"
- The behavioral bug is fixed but the schema cleanup (the breaking change) was not done
Recommendation
Status: KEEP OPEN
Reasoning: The underlying behavioral issue was fixed in PR #10288 (wrangler 4.29.0), but the delivery_delay parameter still exists in the queue producer schema. The issue specifically requests a breaking change to remove this parameter entirely. Currently, users can still set delivery_delay in their config without any warning, but it silently does nothing - this is confusing UX.
Action: The issue should remain open to track the breaking change work to:
- Remove
delivery_delayfrom the queue producer binding schema - Add a deprecation warning or validation error when the parameter is used
- Update documentation to reflect that queue-level settings should be configured via
wrangler queuescommands, not producer bindings
Root Cause Analysis
The issue stems from the original design decision to allow queue producer settings to be configured in the wrangler.toml file under [[queues.producers]]. This was problematic because:
- Queue settings are queue-level, not worker-level: The
delivery_delaysetting affects the entire queue, not just the producer binding - Multiple producer conflict: When multiple workers have producer bindings to the same queue with different
delivery_delayvalues, the last deployed worker's setting wins, leading to unpredictable behavior - Separation of concerns violation: Workers should only define their bindings to queues, not configure queue-level settings
Code References
Schema definition (still contains delivery_delay):
packages/workers-utils/src/config/environment.ts- Queue producer schema includesdelivery_delay?: number
Fixed deploy behavior:
packages/wrangler/src/deploy/deploy.ts-updateQueueProducersfunction was removed by PR #10288packages/wrangler/src/triggers/deploy.ts- No longer calls queue update API during deployment
Proposed Solution
Option 1: Deprecation Warning (Soft Break)
Add a deprecation warning when delivery_delay is set on a producer, then remove in a future major version.
// In packages/wrangler/src/config/validation.ts or similar
function validateQueueProducers(producers: QueueProducer[]) {
for (const producer of producers) {
if (producer.delivery_delay !== undefined) {
logger.warn(
`The 'delivery_delay' setting in [[queues.producers]] is deprecated and has no effect. ` +
`Queue-level settings should be configured using 'wrangler queues update' instead. ` +
`This setting will be removed in a future version.`
);
}
}
}
Option 2: Hard Removal (Breaking Change)
Remove the parameter from the schema entirely, causing validation errors for existing configs.
// In packages/workers-utils/src/config/environment.ts
// Remove this line from the producers schema:
// delivery_delay?: number;
Recommended approach: Option 1 first, then Option 2 in the next major version.
Implementation Difficulty
Difficulty: EASY
Justification:
- The behavioral fix is already done (PR #10288)
- Only schema/validation changes remain
- Clear scope: remove one field from one schema
- No complex logic or API changes required
- Existing tests already updated to not expect the
putQueuecall
Files to Modify
packages/workers-utils/src/config/environment.ts- Remove
delivery_delay?: numberfrom queue producer schema (or mark as deprecated)
- Remove
packages/workers-utils/src/config/validation.ts(if exists) or create validation- Add deprecation warning if
delivery_delayis set
- Add deprecation warning if
packages/wrangler/src/__tests__/deploy.test.ts- Update tests that use
delivery_delayin producer config
- Update tests that use
packages/wrangler/src/__tests__/init.test.ts- May need updates if it tests producer schema
Documentation/CHANGELOG
- Document the breaking change or deprecation
Testing Recommendations
Unit tests:
- Test that
delivery_delayin producer config triggers deprecation warning (if soft break) - Test that
delivery_delayin producer config causes validation error (if hard break)
- Test that
Integration tests:
- Verify
wrangler deploywithdelivery_delayin config still works (soft break) or fails with helpful error (hard break)
- Verify
Migration testing:
- Test upgrade path from wrangler < 4.29.0 configs that have
delivery_delay
- Test upgrade path from wrangler < 4.29.0 configs that have
Suggested Comment
This issue was partially addressed by #10288, which removed the
putQueuecall during deployment so that workers no longer affect queue-level settings. However, thedelivery_delayparameter is still accepted in the queue producer configuration schema - it just silently does nothing now.The issue specifically requests a breaking change to remove this parameter entirely. Should this be:
- A deprecation warning now, with removal in a future major version?
- An immediate removal in the next major version?
This would help avoid confusion where users set
delivery_delayexpecting it to work, but it has no effect.
Notes & Feedback (0)
No notes yet.