Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnqueueJobOptions retry type wrong #1167

Open
wiese opened this issue Nov 28, 2023 · 0 comments
Open

EnqueueJobOptions retry type wrong #1167

wiese opened this issue Nov 28, 2023 · 0 comments

Comments

@wiese
Copy link

wiese commented Nov 28, 2023

Bug Report

Current Behavior
EnqueueJobOptions's retry is configured (using zod) to take 1 to 10 options – that is, it does not allow an empty array. This is correctly enforced at runtime and leads to an error message "body/retry must NOT have fewer than 1 items" if violated. However, the type of retry does not reflect that retry needs to contain at least one option.

Expected behavior/code
The type of EnqueueJobOptions retry indicates that at least one option needs to be provided.

Environment

  • Quirrel version: 1.14.1
  • Node/npm version: v18.18.0

Possible Solution

The zod documentation clearly indicates for .min/.max that

Unlike .nonempty() these methods do not change the inferred type.

so we could use the .nonempty() modifier in addition or instead of of the .min.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant