Description:
The edit_task.go file in the Taskwarrior (tw) layer contains two critical issues that need to be addressed:
-
Double Date Formatting Produces Invalid Datetimes
The file appends T00:00:00 to all date strings, even when the controller has already converted ISO dates to Taskwarrior format. This results in invalid datetime strings like "2026-01-28T14:30:00T00:00:00", which Taskwarrior rejects.
-
Redundant Annotation Block Execution
The condition len(annotations) >= 0 is always true, causing the annotation regeneration block to execute unnecessarily, even when no annotations are provided. This leads to redundant operations, such as deleting and re-adding all existing annotations.
Steps to Reproduce:
-
For Double Date Formatting:
- Submit a request to edit a task with a
wait or due field containing a full ISO datetime (e.g., "2026-01-28T14:30:00").
- Observe that the resulting Taskwarrior command includes an invalid datetime string.
-
For Redundant Annotation Block Execution:
- Submit a request to edit a task without any annotations.
- Observe that the annotation regeneration block is executed, deleting and re-adding all existing annotations.
Expected Behavior:
-
Double Date Formatting:
- The
edit_task.go file should only append T00:00:00 to date-only strings (e.g., "2026-01-28") and leave full datetime strings unchanged.
-
Annotation Block Execution:
- The annotation regeneration block should only execute when
len(annotations) > 0.
Actual Behavior:
-
Double Date Formatting:
- The
edit_task.go file appends T00:00:00 to all date strings, resulting in invalid datetime strings.
-
Annotation Block Execution:
- The annotation regeneration block executes regardless of whether annotations are provided, due to the
len(annotations) >= 0 condition.
Suggested Fix:
-
Double Date Formatting:
- Add a check in
edit_task.go to determine whether the input string is a date-only string or a full datetime string before appending T00:00:00.
-
Annotation Block Execution:
- Update the condition to
len(annotations) > 0 to ensure the block only executes when annotations are provided.
File:
backend/utils/tw/edit_task.go
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Description:
The
edit_task.gofile in the Taskwarrior (tw) layer contains two critical issues that need to be addressed:Double Date Formatting Produces Invalid Datetimes
The file appends
T00:00:00to all date strings, even when the controller has already converted ISO dates to Taskwarrior format. This results in invalid datetime strings like"2026-01-28T14:30:00T00:00:00", which Taskwarrior rejects.Redundant Annotation Block Execution
The condition
len(annotations) >= 0is always true, causing the annotation regeneration block to execute unnecessarily, even when no annotations are provided. This leads to redundant operations, such as deleting and re-adding all existing annotations.Steps to Reproduce:
For Double Date Formatting:
waitorduefield containing a full ISO datetime (e.g.,"2026-01-28T14:30:00").For Redundant Annotation Block Execution:
Expected Behavior:
Double Date Formatting:
edit_task.gofile should only appendT00:00:00to date-only strings (e.g.,"2026-01-28") and leave full datetime strings unchanged.Annotation Block Execution:
len(annotations) > 0.Actual Behavior:
Double Date Formatting:
edit_task.gofile appendsT00:00:00to all date strings, resulting in invalid datetime strings.Annotation Block Execution:
len(annotations) >= 0condition.Suggested Fix:
Double Date Formatting:
edit_task.goto determine whether the input string is a date-only string or a full datetime string before appendingT00:00:00.Annotation Block Execution:
len(annotations) > 0to ensure the block only executes when annotations are provided.File:
backend/utils/tw/edit_task.goScreenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.