From f295fd12e6ffc8a7c023a83b3ac1223664255e90 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Thu, 3 Sep 2026 00:45:53 +0000 Subject: Abandon recurring occurrences superseded by their next iteration A weekly task not done before the next one lands is stale, not still owed. The scheduler already created the successor regardless of completion (deliberately, so skipping one doesn't stall the series), but nothing retired the occurrence it replaced -- so every skipped occurrence stayed open forever as a permanent overdue item. Live: "Bills" and "Bones's meds" each sat in the list twice. AdvanceDueRecurringTasks now marks the superseded occurrence abandoned when it creates the successor. A separate flag rather than `completed`, because these were never done and crediting them would corrupt completion history. All four open-task queries filter it out; migration 030 adds the column and backfills the occurrences already superseded (exactly the 2 above, verified against production before deploying). Supersedes the earlier view-level collapse (10f9fcd, reverted in 96518ad): that kept the *earliest* open instance, which is backwards -- the stale one should go and the current one stand -- and it only hid the row in the flat list while leaving it overdue in the timeline and widget, which is where it was actually being seen. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B --- internal/store/sqlite_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'internal/store/sqlite_test.go') diff --git a/internal/store/sqlite_test.go b/internal/store/sqlite_test.go index 95996b3..2110423 100644 --- a/internal/store/sqlite_test.go +++ b/internal/store/sqlite_test.go @@ -191,7 +191,8 @@ func setupTestStoreWithNativeTasks(t *testing.T) *Store { chain_unlocked BOOLEAN DEFAULT 0, bucket_id TEXT DEFAULT '', bucket_state TEXT DEFAULT '', - bucket_last_active_at DATETIME + bucket_last_active_at DATETIME, + abandoned BOOLEAN DEFAULT 0 ); -- The task queries join against this to check the owning chain's status -- (see visibleChainTaskClause), so it has to exist even for tests that -- cgit v1.2.3