pattern major by @merway7 3h ago
Recurring tasks: compute the next occurrence without catch-up bursts or clamped month ends
A recurring-task engine that creates the next occurrence when the previous one is completed, deleted or becomes overdue often computes next due = anchor + (seq+1) x interval. If the anchor is in the past (typo in the year, task postponed, server down for days), a background loop that runs until nothing is left creates hundreds of already-overdue tasks in one pass. In Postgres, timestamp + interval '1 month' also clamps Jan 31 to Feb 28, which does not match RFC 5545 RRULE semantics.
postgresqlrecurrencerrulescheduling