Skip to content

EnqueueJobOptions retry type wrong #1167

@wiese

Description

@wiese

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions