From a4260c9660f84eb0423a1664445cf6728c2949b0 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 1 Dec 2025 22:06:08 -0800 Subject: [PATCH] fix(db): remove redundant GetCloseReason() calls (bd-bbh) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After adding close_reason column to issues table, two functions still called GetCloseReason() to fetch from events table after already scanning the column. Removed the redundant code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- internal/storage/sqlite/queries.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/internal/storage/sqlite/queries.go b/internal/storage/sqlite/queries.go index cb914f58..2c6b06e4 100644 --- a/internal/storage/sqlite/queries.go +++ b/internal/storage/sqlite/queries.go @@ -222,15 +222,6 @@ func (s *SQLiteStorage) GetIssue(ctx context.Context, id string) (*types.Issue, } issue.Labels = labels - // Fetch close reason if issue is closed - if issue.Status == types.StatusClosed { - closeReason, err := s.GetCloseReason(ctx, issue.ID) - if err != nil { - return nil, fmt.Errorf("failed to get close reason: %w", err) - } - issue.CloseReason = closeReason - } - return &issue, nil } @@ -376,15 +367,6 @@ func (s *SQLiteStorage) GetIssueByExternalRef(ctx context.Context, externalRef s } issue.Labels = labels - // Fetch close reason if issue is closed - if issue.Status == types.StatusClosed { - closeReason, err := s.GetCloseReason(ctx, issue.ID) - if err != nil { - return nil, fmt.Errorf("failed to get close reason: %w", err) - } - issue.CloseReason = closeReason - } - return &issue, nil }