git/dew/main

rec: silently no-ops on malformed input

closed #0011 issues/0011-rec-silently-no-ops-on-malformed-input.md opened
bug

generateRecurringTask discards the error from strconv.Atoi (actions.go around lines 152 and 155):

amount, _ = strconv.Atoi(recStr[:len(recStr)-1])

A task with something like rec:abc ends up with amount 0 and unit d, so completing it silently generates a "next" task with an unchanged due date instead of failing. Same story for any non-numeric amount.

Fix: validate the recurrence string and return a real error instead of generating a bogus task.