From e23c85577cbb0eac8b847dd989072698ff4e7a30 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Fri, 23 Jan 2026 16:15:09 -1000 Subject: Fix calendar dedup: use Unix timestamp to handle timezone differences Events copied across calendars may have different timezone representations in their RFC3339 strings. Using Unix timestamps ensures the same moment in time produces the same dedup key. Co-Authored-By: Claude Opus 4.5 --- internal/api/google_calendar.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/api') diff --git a/internal/api/google_calendar.go b/internal/api/google_calendar.go index 2154351..919976b 100644 --- a/internal/api/google_calendar.go +++ b/internal/api/google_calendar.go @@ -77,11 +77,12 @@ func (c *GoogleCalendarClient) GetUpcomingEvents(ctx context.Context, maxResults } // Deduplicate events (same event may appear in multiple calendars) + // Use Unix timestamp to handle timezone differences seen := make(map[string]bool) var uniqueEvents []models.CalendarEvent for _, event := range allEvents { - // Use summary + start time as dedup key - key := event.Summary + event.Start.Format(time.RFC3339) + // Use summary + unix timestamp as dedup key (handles timezone differences) + key := fmt.Sprintf("%s|%d", event.Summary, event.Start.Unix()) if !seen[key] { seen[key] = true uniqueEvents = append(uniqueEvents, event) -- cgit v1.2.3