The task store was not cleared on an account switch, unlike the calendar,
contacts and the other account-scoped stores, so the next account showed
the previous one's tasks until its own arrived. And a fetch answered after
a later one had started still wrote its list: the outgoing account's
answer could put its tasks back after the switch, and an older answer
could replace a newer one.
clearAllStores now clears the tasks, and each fetch gets a number: only
the latest one's answer or error is kept, and clearing drops the fetches
still under way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- send a calendar's colour only when the user changed it: Stalwart 1.0
accepts only #rgb, #rrggbb or a CSS name, so renaming a calendar that
another client coloured with an 8-digit hex (Apple Calendar) failed
- "Refresh cached data" kept nothing of the calendar store's persisted
state, so it deleted the user's iCal subscriptions, which exist only
there; keep them and drop the rest
- show a notice with a retry when the task list fails to load; it keeps
the tasks it had
- treat a method-level error on creating a task as a failure with its
JMAP type instead of "no id returned"
Stalwart Mail Server strictly validates JSCalendar task properties on CalendarEvent/set and rejects updates containing top-level progressUpdated with invalidProperties (RFC 8984 §5.2.2 only defined progressUpdated on Participant objects, obsoleted in JSCalendar 2.0).
- Omit progressUpdated from toggleTaskComplete in stores/task-store.ts
- Remove progressUpdated from CALENDAR_TASK_PROPERTIES in lib/jmap/client.ts
- Defensively strip progressUpdated in updateCalendarEvent and createCalendarTask
- Make progressUpdated optional in CalendarTask interface
- Add unit tests for task-store and JMAP client task methods
Stalwart's CalendarEvent/query ignores Task-type objects and does not
support the 'types' filter (returns unsupportedFilter error). This
caused tasks both locally created and from external clients like
Thunderbird to disappear on reload.
Root causes:
- CalendarEvent/query only returns @type:'Event' objects on Stalwart,
so tasks were invisible to the query endpoint.
- CALENDAR_EVENT_PROPERTIES lacked Task-specific fields (due, progress,
progressUpdated, priority), causing garbled data when tasks were
fetched with Event properties (e.g. utcStart:'32548-12-04T15:30:07Z').
Changes:
- Add CALENDAR_TASK_PROPERTIES with Task-specific fields (due, progress,
progressUpdated, priority).
- Rewrite getCalendarTasks() to first try CalendarEvent/query with
types:['Task'] filter, then fall back to CalendarEvent/get ids:null
which returns all calendar objects regardless of @type per JMAP spec.
- Rewrite createCalendarTask() to fetch back created tasks using
CALENDAR_TASK_PROPERTIES instead of piggybacking on createCalendarEvent.
- Add comprehensive debug logging throughout the task fetch/create flow
(TaskStore, JMAP client) visible when Debug Mode is enabled.
- Add 'types' field to CalendarEventFilter interface.