Authorization
This page is reference material. For the operator workflow, use How to sync content with Google Calendar.
The deployment-wide OAuth client uses
GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET. Reauthorization preserves the stored calendar identity and an existing refresh token when the token response omits one.
API routes
- Connection status
- Mutate an event
GET /api/calendar/google
Returns the active workspace’s connection state.App-created calendar
The first sync provisions a secondary calendar namedHarmonia Content Calendar. Firestore records a provisioning claim before calling Google.
An ambiguous create is intentionally not retried because Google Calendar does not accept a client-selected calendar ID.
Event projection
The deterministic event ID makes inserts retry-safe. A
409 after an ambiguous insert converges only when strict read-back matches the intended event.
Updates use the current Google ETag in If-Match. A 412 after an ambiguous update converges only when strict read-back matches; otherwise the operation fails visibly.
Persisted sync state
ContentItem.googleCalendarSync contains:
Failure state preserves the previous ETag, link, source revision, and verification timestamp. If content changes concurrently with a successful sync, persistence records
update_required; a verified removal remains removed.
Retry and verification rules
- Network failures,
429, and5xxresponses receive at most three bounded attempts on convergence-safe requests. - Calendar provisioning receives one attempt and locks on an uncertain outcome.
- Validation, authorization, permission, and ordinary conflict failures are not retried.
- A sync is successful only when
events.getmatches ID, summary, description, start, end, transparency, and private properties. - A removal is successful only when
events.getreports404or410. - Offline tests do not prove a live Google account, valid consent screen, deploy-time credentials, or provider availability.
Live evidence checklist
See the exact artifacts required before presenting Google Calendar synchronization as live hackathon evidence.
