A task created on the companion, or tomorrow by an AI assistant, never rang
on the phone: only src/db/repository/tasks.ts scheduled or cancelled
reminders, and applyTaskChange wrote the pulled row without touching them.
A task completed or deleted elsewhere kept its reminder.
- syncRules.ts: reminderPlan(action, task), pure and import-free, returns
'schedule' for an open task with a due date, 'cancel' for a completed
task, a task without a due date or a deletion.
- syncClient.ts: applyTaskChange executes the plan after its local write,
through scheduleTaskReminder and cancelTaskReminder, awaited and with
their errors swallowed as in the task repository. A deletion now falls
through to the reminder instead of returning early; a row kept by
keepLocal still returns before any call.
- tests/syncRules.test.mjs: the cases of reminderPlan.
- tests/smoke.test.cjs: wiring of applyTaskChange, checked by reading the
source (syncClient.ts does not load under node).
- web/src/test/sync: the notifications stub records the calls of each
device, and a ninth scenario covers the reminder scheduled on receipt,
cancelled once the task is completed or deleted elsewhere, and untouched
for a row kept by keepLocal.
No dependency added, no new host, version and versionCode unchanged.
Refs #206
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>