blob: 5d628f2a93cae7680a997986e93d555c90038829 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# [BUG] Fix outdated Todoist task link
## Description
Fix outdated Todoist task link.
## Technical Context
- Affects: `internal/api/todoist.go` (URL construction) or stored `url` field in DB
- Todoist may have changed their URL scheme
- Current URLs may be returning 404 or redirecting incorrectly
## Test Strategy
### Unit Test (Red)
**File:** `internal/api/todoist_test.go`
```go
func TestBuildTaskURL(t *testing.T) {
taskID := "123456789"
url := BuildTaskURL(taskID)
// Assert current Todoist URL format
// Option A: https://todoist.com/showTask?id=123456789
// Option B: https://todoist.com/app/task/123456789
assert.Equal(t, "https://todoist.com/app/task/123456789", url)
}
```
## Proposed Approach
1. Research current Todoist web URL format:
- Check Todoist docs or inspect working links in browser
- Likely format: `https://todoist.com/app/task/{task_id}` or `https://todoist.com/showTask?id={task_id}`
2. Update URL builder in `internal/api/todoist.go`
3. Consider migration for existing cached URLs in database:
- Option A: Update on read (lazy migration)
- Option B: Run migration script to update all stored URLs
4. If URL comes from API response directly, verify we're using the correct field
## Debugging Steps
1. Find a task ID in the database
2. Try current URL format in browser
3. Try alternative formats to find working one
4. Check Todoist API response for canonical URL field
## Affected Components
- `internal/api/todoist.go`
- `internal/api/todoist_test.go`
- Potentially `internal/store/sqlite.go` (if migration needed)
## Definition of Done
- [ ] Task links open correct Todoist page
- [ ] URL builder uses current format
- [ ] Existing cached URLs updated or migrated
- [ ] Unit test validates URL format
|