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
- Create or update a timed task with explicit start/due times, for example 12:00–13:00.
- Pass:
--not-all-day
--not-floating
- Inspect dry-run / request payload.
- 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:
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:
to:
json:"isAllDay,omitempty"
with the dry-run explicitly containing:
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!
Summary
In DidaCLI v0.2.7,
task create/update --not-all-daysendsallDay: falsethrough the Web API mutation payload. The Dida task API expectsisAllDay: false, so the field is ignored and the task remains marked as all-day in the client even whenstartDate,dueDate,timeZone, and recurrence are correct.Environment
Europe/LondonReproduction
--not-all-day--not-floatingObserved 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-daytoopts.AllDay=false, then carries that intoTaskMutation.AllDay, but the Web API JSON field is serialized asallDay:internal/cli/task_cmd.goaround the--all-day/--not-all-dayhandlinginternal/cli/task_cmd.gowhereTaskMutation.AllDayis built for create/updateinternal/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:
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
allDaytoisAllDayand adjust the related dry-run/unit tests to assert thatisAllDay: falseis serialized explicitly when--not-all-dayis used.Thanks!