diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-09-02 23:47:56 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-09-02 23:47:56 +0000 |
| commit | 3e26cd5ad7a0cbd1445f535ccd63c2e79d3580a4 (patch) | |
| tree | 41b6dd8b79f4d078cda1c91570af2f9240ccdce4 /internal/store/sqlite_test.go | |
| parent | 74bf58335d3542d88b32d447b47342a76f5e5449 (diff) | |
Hide paused chains' tasks from the task list
Pausing a chain is supposed to take its work off the list -- that's the
entire point of the control. But the three task-fetching queries only
ever checked `chain_unlocked`, never the owning chain's status, so a
paused chain's head task kept appearing exactly like an active one.
Verified against production: 4 of the 8 visible chain tasks came from
chains that had been explicitly paused ("Will", "ABYC Marine Electrical
certification", "Standard services agreement", "Find a broker who writes
marine trades"). Half the chain clutter on the list was work the user
had already told doot to put away.
Fixed the class, not just the instances: the predicate now lives in one
shared visibleChainTaskClause constant used by all three queries, with a
structural test asserting no query spells it out inline and that every
query still references it. The previous shape -- the same predicate
copy-pasted into three separate query strings -- is exactly why a fourth
query would have gotten it wrong too.
Also added task_chains to sqlite_test.go's leaner test schema, since the
queries now join against it even for chain-less tasks.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B
Diffstat (limited to 'internal/store/sqlite_test.go')
| -rw-r--r-- | internal/store/sqlite_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/store/sqlite_test.go b/internal/store/sqlite_test.go index c64e6b3..95996b3 100644 --- a/internal/store/sqlite_test.go +++ b/internal/store/sqlite_test.go @@ -193,6 +193,15 @@ func setupTestStoreWithNativeTasks(t *testing.T) *Store { bucket_state TEXT DEFAULT '', bucket_last_active_at DATETIME ); + -- The task queries join against this to check the owning chain's status + -- (see visibleChainTaskClause), so it has to exist even for tests that + -- only ever create plain, chain-less tasks. + CREATE TABLE IF NOT EXISTS task_chains ( + id TEXT PRIMARY KEY, + project_id TEXT DEFAULT '', + status TEXT DEFAULT 'active', + created_at DATETIME DEFAULT CURRENT_TIMESTAMP + ); ` if _, err := db.Exec(schema); err != nil { t.Fatalf("Failed to create schema: %v", err) |
