Skip to content

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

Closed as not planned

Description

@892041548

Verified against (commit SHA or released version)

commit 988c035 — @testsprite/testsprite-cli 0.14.0

Discord Username / User ID

zzzzzy

What does this improvement do?

schedule create rejects an empty --name (--name is required and must not be empty, exit 5), but schedule update --name "" silently accepts it and sends the empty string to the server. Same class as #363 (empty --cron on update). Distinct from PR #371: that PR guards --cron only — verified 2026-10-15 that --name is still spread into the PATCH body raw in runUpdate, so this is a separate unguarded flag, not a duplicate.

Details / implementation notes

Reproduction (built from source at 988c035, v0.14.0):

$ testsprite schedule create --name "" --cron "0 9 * * *" --target-type project --target-id x --dry-run
Error: Invalid request.
--name is required and must not be empty

exit 5 — correct

$ testsprite schedule update sch_1 --name "" --dry-run
[dry-run] sample response — not from the server
...

exit 0 — empty name silently accepted

Expected: update applies the same non-empty guard as create when --name is passed.
Actual: empty (and whitespace-only) --name passes through to the PATCH body.
Suggested fix: in runUpdate (src/commands/schedule.ts), reject empty/whitespace-only --name with --name must not be empty before building the request body.

Confirmations

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

Activity

  1. 892041548 commented on Oct 16, 2026

    @892041548
    Author

    /assign

  2. testsprite-hob commented on Oct 16, 2026

    @testsprite-hob

    Thanks for the interest, @892041548! This issue hasn't been accepted for implementation yet — see the triage comment (a maintainer will label it accepted once it is). Feel free to check back, or ping us on Discord if it's been quiet.

  3. fyZhang66 commented on Oct 22, 2026

    @fyZhang66
    Contributor

    Thanks @892041548. The API already rejects an empty name (400, exit 5) and nothing changes, so the only difference is where the error comes from. Closing as not planned.

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 submissions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions