Skip to content

fix(google-calendar-sa): skip notifications outside business hours#479

Merged
JonasJesus42 merged 3 commits into
mainfrom
fix/scheduler-business-hours
Jun 26, 2026
Merged

fix(google-calendar-sa): skip notifications outside business hours#479
JonasJesus42 merged 3 commits into
mainfrom
fix/scheduler-business-hours

Conversation

@JonasJesus42

@JonasJesus42 JonasJesus42 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Scheduler was firing at 01:51 AM, 03:56 AM etc. Now checks current hour in America/Sao_Paulo and skips the tick entirely outside 9:00-18:00 — no API calls, no notifications.


Summary by cubic

Skip google-calendar-sa scheduler scans outside 09:00–18:00 BRT (America/Sao_Paulo) and persist SA connection configs in Supabase so scanning survives restarts. Also filter out non-actionable events to prevent unnecessary triggers.

  • Bug Fixes

    • Business-hours guard via isBusinessHours() (BRT) with early return in tick().
    • Pre-emit filtering: skip all-day events, events without hangoutLink, and events with <2 real attendees to cut noisy runs.
  • New Features

    • Persist SA configs in Supabase table calendar_sa_connections and bootstrap on startup to repopulate the connection cache after pod restarts.

Written for commit 2784585. Summary will update on new commits.

Review in cubic

JonasJesus42 and others added 3 commits June 26, 2026 16:43
…-18 BRT)

Scheduler now checks the current hour in America/Sao_Paulo before
scanning. Outside 9:00-18:00 the tick returns immediately — no API
calls, no notifications.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…urvival

The scheduler needs SERVICE_ACCOUNT_JSON + IMPERSONATE_EMAILS to scan
calendars, but these were only cached in memory via onChange (lost on pod
restart). Now onChange also persists to a calendar_sa_connections table,
and bootstrap loads all configs into the connection cache on startup.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…riggers

Skip all-day events (no dateTime), events without a meeting link
(no hangoutLink), and events with fewer than 2 real attendees.
Previously these were only filtered in the automation prompt, causing
unnecessary trigger emissions and automation runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@JonasJesus42 JonasJesus42 merged commit e0feeae into main Jun 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant