fix: surface a00.un API errors + document dueDate-clearing limitation (v0.4.15)
- fw_client: detect nested a00.un errors (previously silent-failed as success) - update_task: add clear_due_date=True parameter that returns a clear error explaining the Family Wall API cannot clear dueDate once set - SPEC.md: document all tested clearing candidates and their API responses, add Fehlerstruktur-Varianten section - Verified: dueDate cannot be removed via any form-encoded value; all invalid date strings are rejected via a00.un.un (silently swallowed before this fix) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
__version__ = "0.4.14"
|
||||
__version__ = "0.4.15"
|
||||
|
||||
@@ -185,4 +185,12 @@ class FamilyWallClient:
|
||||
msg = f"API error from {endpoint!r}: {error_data}"
|
||||
raise FamilyWallError(msg, response_data=body)
|
||||
|
||||
# Some endpoints (e.g. taskupdate2) return per-call errors nested under
|
||||
# a00.un.un instead of top-level — detect and surface them.
|
||||
a00 = body.get("a00", {})
|
||||
if isinstance(a00, dict) and "un" in a00:
|
||||
nested = a00["un"]
|
||||
msg = f"API error from {endpoint!r}: {nested}"
|
||||
raise FamilyWallError(msg, response_data=body)
|
||||
|
||||
return body
|
||||
|
||||
@@ -740,6 +740,7 @@ def update_task(
|
||||
description: str | None = None,
|
||||
category_id: str | None = None,
|
||||
due_date: str | None = None,
|
||||
clear_due_date: bool = False,
|
||||
assignee_ids: list[str] | None = None,
|
||||
list_id: str | None = None,
|
||||
) -> str:
|
||||
@@ -756,7 +757,11 @@ def update_task(
|
||||
(e.g. ``taskCategory/23431854_200``). Only meaningful for
|
||||
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.
|
||||
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.
|
||||
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
|
||||
@@ -766,6 +771,14 @@ 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 (
|
||||
text is None
|
||||
and description is None
|
||||
|
||||
Reference in New Issue
Block a user