diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-18 15:24:58 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-18 15:24:58 -1000 |
| commit | 8dbb6f43577b8a86e94ef7aaee196f9743356643 (patch) | |
| tree | 8713bf776f0c01c3d0fc94d906667e2e839e79f3 /internal/store/sqlite.go | |
| parent | 143166ce759ce2cb0133b7438db36b844a9db1a7 (diff) | |
Implement unified task completion with cache sync (Phase 3 Step 7)
Add checkbox UI to Tasks tab for completing Todoist tasks and archiving
Trello cards. Fix cache synchronization so completed items stay gone
after page reload by deleting them from SQLite cache after API success.
- Add HandleCompleteAtom handler routing to Todoist/Trello APIs
- Add DeleteTask/DeleteCard store methods for cache removal
- Add htmx.process() calls after innerHTML updates in app.js
- Add comprehensive tests for completion and cache behavior
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/store/sqlite.go')
| -rw-r--r-- | internal/store/sqlite.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/store/sqlite.go b/internal/store/sqlite.go index c97d0af..79f5cc8 100644 --- a/internal/store/sqlite.go +++ b/internal/store/sqlite.go @@ -167,6 +167,12 @@ func (s *Store) GetTasks() ([]models.Task, error) { return tasks, rows.Err() } +// DeleteTask removes a task from the cache by ID +func (s *Store) DeleteTask(id string) error { + _, err := s.db.Exec(`DELETE FROM tasks WHERE id = ?`, id) + return err +} + // Notes operations // SaveNotes saves multiple notes to the database @@ -403,6 +409,12 @@ func (s *Store) IsCacheValid(key string) (bool, error) { return cm.IsCacheValid(), nil } +// InvalidateCache removes the cache metadata for a given key, forcing a refresh on next fetch +func (s *Store) InvalidateCache(key string) error { + _, err := s.db.Exec(`DELETE FROM cache_metadata WHERE key = ?`, key) + return err +} + // Boards operations // SaveBoards saves multiple boards to the database @@ -538,3 +550,9 @@ func (s *Store) GetBoards() ([]models.Board, error) { return boards, cardRows.Err() } + +// DeleteCard removes a card from the cache by ID +func (s *Store) DeleteCard(id string) error { + _, err := s.db.Exec(`DELETE FROM cards WHERE id = ?`, id) + return err +} |
