Skip to content

[Bug] --not-all-day sends allDay instead of isAllDay, so timed tasks remain all-day #19

Description

@zeshuochen

Summary

In DidaCLI v0.2.7, task create/update --not-all-day sends allDay: false through the Web API mutation payload. The Dida task API expects isAllDay: false, so the field is ignored and the task remains marked as all-day in the client even when startDate, dueDate, timeZone, and recurrence are correct.

Environment

  • DidaCLI: v0.2.7
  • OS: Windows 11
  • Channel: Web API
  • Time zone used in the test: Europe/London

Reproduction

  1. Create or update a timed task with explicit start/due times, for example 12:00–13:00.
  2. Pass:
    • --not-all-day
    • --not-floating
  3. Inspect dry-run / request payload.
  4. Open the task in the Dida365 client.

Observed payload

{
  "allDay": false,
  "isFloating": false
}

Actual result

The task is still shown with All day enabled, and the concrete start/end time is not displayed as a timed task.

Expected result

The request should send:

{
  "isAllDay": false,
  "isFloating": false
}

and the task should appear as a normal timed task.

Root cause

The CLI correctly maps --not-all-day to opts.AllDay=false, then carries that into TaskMutation.AllDay, but the Web API JSON field is serialized as allDay:

  • internal/cli/task_cmd.go around the --all-day/--not-all-day handling
  • internal/cli/task_cmd.go where TaskMutation.AllDay is built for create/update
  • internal/webapi/tasks.go, where the field is currently tagged as:
json:"allDay,omitempty"

The compatible field name is isAllDay.

Relevant v0.2.7 source:

Verified workaround / patch

I tested a minimal local patch changing the mutation field mapping from:

json:"allDay,omitempty"

to:

json:"isAllDay,omitempty"

with the dry-run explicitly containing:

"isAllDay": false

Using that patched build, a previously all-day test task was successfully converted into a timed task. I then applied the same fix to 33 existing scheduled course tasks; all 33 updated successfully with their start/due times, timezone, recurrence, description, project, priority, and floating state unchanged.

Suggested fix

Update the Web API task mutation field from allDay to isAllDay and adjust the related dry-run/unit tests to assert that isAllDay: false is serialized explicitly when --not-all-day is used.

Thanks!

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions