From 6a59098c3096f5ebd3a61ef5268cbd480b0f1519 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Tue, 20 Jan 2026 10:40:29 -1000 Subject: Implement efficient sync for Todoist and Trello APIs - Add Todoist Sync API v9 support with incremental sync tokens - Store sync tokens in SQLite for persistence across restarts - Add field filtering to Trello API calls to reduce payload size - Update handlers to use incremental sync (merge changes vs full replace) Co-Authored-By: Claude Opus 4.5 --- internal/api/trello.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/api/trello.go') diff --git a/internal/api/trello.go b/internal/api/trello.go index 91d6d66..037c881 100644 --- a/internal/api/trello.go +++ b/internal/api/trello.go @@ -68,6 +68,7 @@ func (c *TrelloClient) GetBoards(ctx context.Context) ([]models.Board, error) { params.Set("key", c.apiKey) params.Set("token", c.token) params.Set("filter", "open") + params.Set("fields", "id,name") // Only fetch required fields reqURL := fmt.Sprintf("%s/members/me/boards?%s", c.baseURL, params.Encode()) req, err := http.NewRequestWithContext(ctx, "GET", reqURL, nil) @@ -111,6 +112,7 @@ func (c *TrelloClient) GetCards(ctx context.Context, boardID string) ([]models.C params.Set("key", c.apiKey) params.Set("token", c.token) params.Set("filter", "visible") + params.Set("fields", "id,name,idList,due,url,idBoard") // Only fetch required fields reqURL := fmt.Sprintf("%s/boards/%s/cards?%s", c.baseURL, boardID, params.Encode()) req, err := http.NewRequestWithContext(ctx, "GET", reqURL, nil) @@ -174,6 +176,7 @@ func (c *TrelloClient) getLists(ctx context.Context, boardID string) ([]models.L params := url.Values{} params.Set("key", c.apiKey) params.Set("token", c.token) + params.Set("fields", "id,name") // Only fetch required fields reqURL := fmt.Sprintf("%s/boards/%s/lists?%s", c.baseURL, boardID, params.Encode()) req, err := http.NewRequestWithContext(ctx, "GET", reqURL, nil) -- cgit v1.2.3