feat(tasks): implement clear_due_date via FiZ \$empty sentinel (v0.4.16)

The Family Wall API (FiZ framework) uses the special string "\$empty"
to clear optional date fields. Sending dueDate=\$empty to taskupdate2
reliably removes the due date (verified via direct API probing).

- update_task(clear_due_date=True) now sends dueDate=\$empty instead
  of returning an error
- Remove the "not supported" limitation message from the docstring
- Update SPEC.md, README.md, CLAUDE.md to document the discovery
- Bump version to 0.4.16

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 10:57:21 +02:00
parent 6c955d67c8
commit 0517241ee5
6 changed files with 39 additions and 37 deletions
+10 -13
View File
@@ -758,10 +758,8 @@ def update_task(
shopping lists; ignored for TODO lists.
due_date: New due date in ISO 8601 format (e.g. ``"2026-04-30T18:00:00"``).
Omit to leave unchanged. Cannot be used together with *clear_due_date*.
clear_due_date: Set to ``True`` to request removal of the due date.
**Note:** The Family Wall API does not support clearing a due date once
set — this will return an informational error. This parameter exists to
surface the limitation explicitly rather than silently doing nothing.
clear_due_date: Set to ``True`` to remove the due date from the task.
Cannot be used together with *due_date*.
assignee_ids: New list of member IDs from get_members (e.g. ``["23431898"]``).
Pass an empty list to remove all assignees. Omit to leave unchanged.
list_id: Move the task to a different list by providing the target list ID
@@ -771,23 +769,19 @@ def update_task(
Returns:
JSON success indicator or an error message.
"""
if clear_due_date:
return (
"Error: Removing a due date is not supported by the Family Wall API. "
"The 'dueDate' field cannot be cleared once set — this is a known "
"limitation of the API (all tested values are rejected as invalid dates). "
"You can set a different future date instead."
)
if clear_due_date and due_date is not None:
return "Error: 'clear_due_date' and 'due_date' cannot be used together."
if (
text is None
and description is None
and category_id is None
and due_date is None
and not clear_due_date
and assignee_ids is None
and list_id is None
):
return "Error: At least one of 'text', 'description', 'category_id', 'due_date', 'assignee_ids', or 'list_id' must be provided."
return "Error: At least one of 'text', 'description', 'category_id', 'due_date', 'clear_due_date', 'assignee_ids', or 'list_id' must be provided."
params: dict[str, Any] = {"metaId": task_id}
if text is not None:
@@ -796,7 +790,10 @@ def update_task(
params["description"] = description
if category_id is not None:
params["taskCategoryId"] = category_id
if due_date is not None:
if clear_due_date:
# The FiZ framework uses "$empty" as a sentinel to clear optional date fields.
params["dueDate"] = "$empty"
elif due_date is not None:
params["dueDate"] = due_date
if assignee_ids is not None:
params["assignee"] = assignee_ids if assignee_ids else ""