diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-23 15:59:12 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-23 15:59:12 -1000 |
| commit | d11334c0999efb670a8eab93527a50f644fdfceb (patch) | |
| tree | 20dbf478122ea2663d91cc2259c5163bbc613a64 /internal/api | |
| parent | 54f091e1b920943967c6aebc9c1f3122ce52e267 (diff) | |
Fix high priority issues from code review
- Default password: Fatal error in production if DEFAULT_PASS not set
- API timeouts: Reduce from 30s to 15s (4 APIs × 15s < 60s global)
- Trello lists: Log warning when list fetch fails instead of silent ignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/api')
| -rw-r--r-- | internal/api/plantoeat.go | 2 | ||||
| -rw-r--r-- | internal/api/todoist.go | 2 | ||||
| -rw-r--r-- | internal/api/trello.go | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/internal/api/plantoeat.go b/internal/api/plantoeat.go index 6fe640d..1dae246 100644 --- a/internal/api/plantoeat.go +++ b/internal/api/plantoeat.go @@ -26,7 +26,7 @@ func NewPlanToEatClient(apiKey string) *PlanToEatClient { return &PlanToEatClient{ apiKey: apiKey, httpClient: &http.Client{ - Timeout: 30 * time.Second, + Timeout: 15 * time.Second, }, } } diff --git a/internal/api/todoist.go b/internal/api/todoist.go index 14c6c0b..689bf10 100644 --- a/internal/api/todoist.go +++ b/internal/api/todoist.go @@ -30,7 +30,7 @@ func NewTodoistClient(apiKey string) *TodoistClient { apiKey: apiKey, baseURL: todoistBaseURL, httpClient: &http.Client{ - Timeout: 30 * time.Second, + Timeout: 15 * time.Second, }, } } diff --git a/internal/api/trello.go b/internal/api/trello.go index 665bce0..4c4dc95 100644 --- a/internal/api/trello.go +++ b/internal/api/trello.go @@ -35,7 +35,7 @@ func NewTrelloClient(apiKey, token string) *TrelloClient { token: token, baseURL: trelloBaseURL, httpClient: &http.Client{ - Timeout: 30 * time.Second, + Timeout: 15 * time.Second, }, } } @@ -142,7 +142,9 @@ func (c *TrelloClient) GetCards(ctx context.Context, boardID string) ([]models.C // Fetch lists to get list names lists, err := c.getLists(ctx, boardID) listMap := make(map[string]string) - if err == nil { + if err != nil { + log.Printf("Warning: failed to fetch lists for board %s, cards will have empty list names: %v", boardID, err) + } else { // Build map of list ID to name for _, list := range lists { listMap[list.ID] = list.Name |
