fix(google-calendar-sa): skip notifications outside business hours#479
Merged
Conversation
…-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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-sascheduler 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
isBusinessHours()(BRT) with early return intick().hangoutLink, and events with <2 real attendees to cut noisy runs.New Features
calendar_sa_connectionsand bootstrap on startup to repopulate the connection cache after pod restarts.Written for commit 2784585. Summary will update on new commits.