Skip to content

[Hackathon] fix(schedule): update --cron "" bypasses the empty-cron guard enforced by create #363

Open

Description

@sheepyd

Verified against (commit SHA or released version)

988c035

Discord Username / User ID

sheep_yd

What does this improvement do?

Summary

schedule create rejects an empty --cron with --cron is required and must not be empty, but schedule update --cron "" has no such check — it prints the frequency advisory and PATCHes cron: "" to the API.

What happened

  • runCreate (src/commands/schedule.ts) validates up front: opts.cron === undefined || opts.cron.trim().length === 0 → localValidationError.
  • runUpdate builds the PATCH body with ...(opts.cron !== undefined ? { cron: opts.cron } : {}) and never checks for an empty string, so --cron "" sails through to the server instead of failing fast locally.

Expected

schedule update should apply the same empty-cron validation as create.

Suggested fix

Reuse the same guard in runUpdate before building the request body, plus a unit test mirroring the create-side case. Happy to pick this up.

Details / implementation notes

No response

Confirmations

  • I have searched existing issues and this is not a duplicate.
  • I have provided my Discord identity above for reward coordination.

Activity

  1. x15967311210-crypto commented on Oct 11, 2026

    @x15967311210-crypto

    PR #371 is up for this one: it gives schedule update the same trim-and-reject-blank contract schedule create already enforces for --cron, with tests on both verbs (verified non-vacuous against the previous schedule.ts).

    Linking it here so it can be triaged. Getting this accepted would let it be claimed and the PR gate pass. Thanks!

  2. sheepyd commented on Oct 11, 2026

    @sheepyd
    Author

    Thanks for the interest, @x15967311210-crypto!

    Just for maintainer context: I'm the reporter of this issue, and as noted in the description ("Happy to pick this up"), I've been planning to submit the fix myself once it's triaged, following the issue-first flow in CONTRIBUTING.md. Since the Season 4 CLI window opens on Oct 16, I was holding off rather than opening a PR before the issue is accepted.

    @TestSprite maintainers — when this gets triaged, could the reporter be considered for the assignment? I'll claim it right after acceptance and have a fix with tests (mirroring the schedule create empty-cron case) ready to open immediately. Of course, happy to go with whatever the maintainers decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    hackathonCLI hackathon submissionsneeds-triageNew issue/PR awaiting first triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions