Feature ID: CE-21Documentation Index
Fetch the complete documentation index at: https://docs.encoreos.io/llms.txt
Use this file to discover all available pages before exploring further.
Created: 2026-03-31
Status: ✅ Complete
Overview
CE-21 Calendar & Scheduling Integration uses three edge functions for OAuth, sync, and free/busy queries.Edge Functions
| Function | Purpose | Trigger |
|---|---|---|
calendar-oauth-callback | OAuth code exchange, token encryption, connection creation | User-initiated OAuth redirect |
calendar-sync | Two-way event sync (poll or webhook) | Cron (configurable interval) or webhook |
calendar-freebusy | Free/busy availability queries | On-demand from UI |
calendar-schedule | Create meeting on external calendar | On-demand from ScheduleMeetingDialog |
Sync Configuration
Sync poll interval is configured per-organization viace_module_settings.calendar_sync_poll_interval_minutes (default: 15 minutes, range: 5–60).
Cron Setup
To enable automatic sync polling, create apg_cron job or Supabase Cron that invokes calendar-sync at the configured interval:
Webhook Setup (Google/Microsoft)
For real-time sync via push notifications:- Google Calendar: Configure a watch channel pointing to
{SUPABASE_URL}/functions/v1/calendar-sync - Microsoft Graph: Register a subscription for calendar change notifications
Monitoring
- Edge function logs: Supabase Dashboard → Edge Functions → Logs
- Sync failures: Check
ce_calendar_events.sync_status = 'error' - Connection health: Check
ce_calendar_connections.last_sync_atfor stale connections
Troubleshooting
| Symptom | Check |
|---|---|
| Events not syncing | sync_enabled on connection; last_sync_at timestamp; edge function logs |
| OAuth failure | Token expiry; refresh token validity; provider API quotas |
| Free/busy timeout | Calendar API rate limits; connection token validity |