From aaf1f0236b330917940168fc0fd86adfc0d2c6f9 Mon Sep 17 00:00:00 2001 From: claude Date: Thu, 6 Aug 2026 02:10:22 +0400 Subject: [PATCH] store/tasks: dedupe live-status literal against the named constants (V-581) lookupLiveTaskByNorm hardcoded 'candidate','open' in SQL, drifting from liveTaskStatuses which ListTasks already uses for the same query. Bind the constants instead so there is one place that names the live set. --- internal/store/tasks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/store/tasks.go b/internal/store/tasks.go index 8e37258..57c5b51 100644 --- a/internal/store/tasks.go +++ b/internal/store/tasks.go @@ -246,7 +246,7 @@ func (s *Store) lookupTaskByExternalID(ctx context.Context, ext string) (Task, e // lookupLiveTaskByNorm finds the outstanding task with this normalised text. func (s *Store) lookupLiveTaskByNorm(ctx context.Context, norm string) (Task, error) { row := s.db.QueryRowContext(ctx, taskSelect+` - WHERE norm = ? AND status IN ('candidate','open')`, norm) + WHERE norm = ? AND status IN (?,?)`, norm, liveTaskStatuses[0], liveTaskStatuses[1]) t, err := scanTask(row) if errors.Is(err, sql.ErrNoRows) { return Task{}, ErrTaskNotFound