From 44bcaa99cae29445ab222501393a3669f850bf92 Mon Sep 17 00:00:00 2001 From: Jonas Jesus Date: Wed, 24 Jun 2026 17:14:02 -0300 Subject: [PATCH 1/2] fix(google-calendar-sa): skip events that already started in scheduler Events with minutesUntilStart < 0 were not filtered, causing past meetings to trigger notifications on first scheduler tick. Co-Authored-By: Claude Opus 4.6 --- google-calendar-sa/server/lib/scheduler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google-calendar-sa/server/lib/scheduler.ts b/google-calendar-sa/server/lib/scheduler.ts index 8f5d7eb4..9e2591cb 100644 --- a/google-calendar-sa/server/lib/scheduler.ts +++ b/google-calendar-sa/server/lib/scheduler.ts @@ -117,7 +117,8 @@ async function scanConnection(conn: CachedConnection): Promise { const minutesUntilStart = Math.round( (new Date(startTime).getTime() - now.getTime()) / 60000, ); - if (minutesUntilStart > conn.leadMinutes) continue; + if (minutesUntilStart < 0 || minutesUntilStart > conn.leadMinutes) + continue; const dedupKey = `${conn.connectionId}:${email}:${event.id}:${startTime}`; if (notified.has(dedupKey)) continue; From d0c06ca8d049c553c769fad01e418a15192c7798 Mon Sep 17 00:00:00 2001 From: Jonas Jesus Date: Wed, 24 Jun 2026 17:22:53 -0300 Subject: [PATCH 2/2] fix(google-calendar-sa): dedup by eventId only, not per-email The same meeting appears in multiple impersonated emails. Including the email in the dedup key caused duplicate notifications across scheduler ticks. Now the key is connectionId:eventId:startTime. Co-Authored-By: Claude Opus 4.6 --- google-calendar-sa/server/lib/scheduler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-calendar-sa/server/lib/scheduler.ts b/google-calendar-sa/server/lib/scheduler.ts index 9e2591cb..f944a7a8 100644 --- a/google-calendar-sa/server/lib/scheduler.ts +++ b/google-calendar-sa/server/lib/scheduler.ts @@ -120,7 +120,7 @@ async function scanConnection(conn: CachedConnection): Promise { if (minutesUntilStart < 0 || minutesUntilStart > conn.leadMinutes) continue; - const dedupKey = `${conn.connectionId}:${email}:${event.id}:${startTime}`; + const dedupKey = `${conn.connectionId}:${event.id}:${startTime}`; if (notified.has(dedupKey)) continue; try {