Prompt
How do I support cancellations and updates across synced calendars?
Latest observation
To support cancellations and updates across synced calendars, treat your app as the source of truth for the event’s identity and version, and then map that event to each calendar provider’s native event ID.
Core idea
Maintain your own internal event record with:
- stable internal event ID
- provider-specific calendar event IDs
- last synced version / updated timestamp
- sync status per provider
That lets you send:
- updates when the event changes
- deletes/cancellations when the event is removed or canceled
Recommended data model
Store something like:
{
"internalEventId": "evt_123",
"title": "Team Meeting",
"start": "2026-10-20T15:00:00Z",
"end": "2026-10-20T15:30:00Z",
"status": "confirmed",
"updatedAt": "2026-10-15T12:00:00Z",
"providers": {
"google": {
"calendarId": "primary",
"eventId": "google_evt_abc",
"etag": "\"xyz\"",
"syncedAt": "2026-10-15T12:01:00Z"
},
"outlook": {
"calendarId": "AAMk...",
"eventId": "outlook_evt_def",
"changeKey": "CK123",
"syncedAt": "2026-10-15T12:02:00Z"
}
}
}
Handling updates
When the event changes in your system:
- Compare the new event to the last synced version.
- For each synced provider:
- fetch the provider event ID from your mapping
- send an update request using that provider’s native API
- Update your stored sync metadata on success
Best practices
- Use optimistic concurrency:
- Google:
etag - Outlook/Microsoft Graph:
changeKey
- Google:
- If the provider rejects the update because the event changed remotely, refetch and reconcile.
Handling cancellations
There are two common meanings:
1. Soft cancel
The event is canceled but retained in your system history.
- Set internal status to
cancelled - Push a cancellation to each provider
- Optionally keep the record for audit/history
2. Hard delete
The event is removed from your system entirely.
- Delete from each provider using the mapped provider event ID
- Then remove local mapping, or archive it for recovery
Important
For synced calendars, prefer cancellation over blind deletion when the user expects attendees to see that the meeting was canceled rather than just disappearing.
Provider-specific behavior
Google Calendar
- Use
events.patchorevents.updatefor changes - Use
events.deletefor removal - If you want attendees notified, set
sendUpdates=allor similar
Microsoft Outlook / Graph
- Use
PATCH /events/{id}for updates - Use
DELETE /events/{id}for cancellation/removal - For organizer scenarios, deleting often sends cancellation semantics depending on implementation
iCalendar / CalDAV
- Usually require generating updated
VEVENT - For cancellations, send a
STATUS:CANCELLEDupdate with the sameUID - Increment
SEQUENCEon each update
Use stable identity fields
For interoperability, every event should have:
- UID: stable across systems
- SEQUENCE: increment on each meaningful update
- DTSTAMP: timestamp of the modification
- STATUS:CANCELLED when canceled
If you support ICS feeds or CalDAV, this is essential.
Webhooks and inbound sync
If changes can happen in external calendars too, you also need to handle inbound updates:
- Subscribe to provider webhooks/push notifications
- Fetch the changed event
- Match it by provider event ID or UID
- Update your internal record
- Re-sync to other connected calendars if needed
Avoid duplicate events
To prevent duplicates:
- never create a new provider event for an update if you already have a mapped
eventId - only create new events for brand-new internal events
- persist mappings reliably
- if a provider event is missing, decide whether to recreate it or mark sync as broken
Dealing with partial sync failures
If one provider update succeeds and another fails:
- mark per-provider sync state
- retry failed providers
- don’t assume all calendars are in sync just because one succeeded
- expose sync status to the user if needed
Example states:
syncedpendingfailedconflict
Practical workflow
On create
- create internal event
- create event on each connected calendar
- store provider IDs
On update
- update internal event
- push changes to each provider using stored IDs
On cancel/delete
- mark canceled or deleted internally
- delete/cancel each provider event using stored IDs
Key implementation rule
Never rely on title/time matching to identify synced events.
Always use the stored mapping between your event and each provider’s native event ID.
If you want, I can also give you:
- a database schema for this sync model,
- example API flows for Google + Microsoft Graph, or
- a state machine for event lifecycle and sync status.