diff --git a/google-calendar-sa/server/lib/scheduler.ts b/google-calendar-sa/server/lib/scheduler.ts index 8f5d7eb4..f944a7a8 100644 --- a/google-calendar-sa/server/lib/scheduler.ts +++ b/google-calendar-sa/server/lib/scheduler.ts @@ -117,9 +117,10 @@ 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}`; + const dedupKey = `${conn.connectionId}:${event.id}:${startTime}`; if (notified.has(dedupKey)) continue; try {