Skip to content

bug: task update silently discards --due when combined with --priority #464

Description

@tardio-clockero

Summary

td task update --due <string> --priority <p> silently discards the due change. The command reports success, priority is applied, and the recurrence is left untouched. Running --due on its own works.

This bites hardest on recurring tasks: a payment task that should fire on the 1st and the 15th silently stays monthly, and nothing in the output says so.

Reproduction

TID=$(td task add "repro" --project Inbox --due "every 1 months" -q)

# works
td task update id:$TID --due "every 1st, 15th"
# server: every 1st, 15th   ✅

td task update id:$TID --due "every 1 months"

# silently dropped
td task update id:$TID --due "every 2nd, 16th" --priority p1
# CLI: "Updated: repro (id:...)"
# server: every 1 months, priority 4   ❌

Only --priority triggers it. Same task, same --due value, other flags:

Combined with Result
--priority p2 due discarded
--labels compra applied
--content "..." applied
--assignee me applied
(nothing) applied

Root cause is the API, not the CLI

src/commands/task/update.ts maps both fields correctly — it sets args.dueString and args.priority independently. The drop happens server-side. Same behaviour straight against the REST endpoint, no CLI involved:

curl -X POST "https://api.todoist.com/api/v1/tasks/$TID" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"due_string":"every 5th, 19th","priority":3}'
# HTTP 200
# GET afterwards -> due: "every 1 months", priority: 3

due_string is ignored whenever priority is present in the same payload. No error, no warning, HTTP 200.

Filing it here since the CLI is the surface where users meet it and Doist maintains both — happy to move it if there's a better venue for the API side.

Suggested handling in the CLI

Whatever happens upstream, the CLI shouldn't report success for a change it didn't make. Two options:

  1. Split the request — send the priority patch and the due patch as two calls when both flags are present. Invisible to the user, fixes it today.
  2. Verify and warn — compare the returned due against what was requested and surface a warning when they differ.

Option 1 keeps the command honest with no new output. I'm happy to open a PR for it if you'd take that approach.

Environment

  • td 3.1.4
  • @doist/todoist-sdk 13.0.0
  • API v1, macOS

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