Self-review of the PR: the Sync bullet said « au moins un appel natif par
tâche reçue ». The pull makes one call to the notifications service per
task it applies; the native calls behind it vary (up to two to schedule,
one to cancel, none for a task to schedule while notifications are off),
so the bullet now counts the service calls only.
Refs #206
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- Sync zone: a task received by the pull gets its reminder through
reminderPlan, executed by applyTaskChange after its local write; a row
kept by keepLocal is left alone; cost per received task and known limits.
- Verification commands: the sync harness counts nine scenarios. Its
notifications stub records the calls, answers at once and never throws,
so the await and the try/catch of applyTaskChange hold by the smoke check
alone.
Refs #206
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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>