Appointments Automatically Cancelled
-
We don’t have cancel links in any emails to prevent auto clicking and Google calendar sync is set to 15 minutes. This is what Claude Code thinks is the issue with appointments being made then automatically cancelled:
● CRITICAL ISSUE IDENTIFIEDI found the root cause of your automatic cancellation problem. Here’s what’s happening:
The Problem
The plugin’s Google sync has a dangerous logic flaw in google_cron.php (lines 179-227):
- Every 15-30 minutes (based on your cron schedule), the sync runs
- It fetches events from Google Calendar (810 events in recent syncs)
- It compares these events against your database
- Any appointment in your database that’s NOT in the Google Calendar response gets automatically cancelled
- This happens in the pull_deleted_events() method at line 179 Evidence from Logs Your logs show constant automatic cancellations:
- November 11-25: 100+ appointments automatically cancelled
- Today alone (Nov 25): 8 appointments cancelled so far (3 at 9:57 AM, 3 at 10:13 AM, 2 at 10:30 AM)
- Pattern: The “Total sync events” fluctuates (810 → 808 → fewer), causing appointments to be cancelled Why This Happens The sync assumes if an event isn’t returned by Google Calendar API, it was deleted. But events can be “missing” from the API response due to:
- Google API pagination issues – Not all events returned
- Temporary API errors/timeouts – Incomplete data fetched
- Date range filtering – Events outside the 63-day window
- Calendar permission changes
- Race conditions during booking The Flawed Code (google_cron.php:207-226)
// Finds appointments NOT in Google Calendar response
$ids = array_filter($ids, function($value) use ($list_of_imported) {
return !in_array($value->ext_id, $list_of_imported);
}); // Then AUTOMATICALLY cancels them!
if ($this->delete_strategy == '0') {
$rows = $this->strategy_cancel_appointments($ids); // ← YOUR PROBLEM
$logger->info('Canceled Appointments ' . $rows);
}- Immediate Solutions Option 1: Disable Auto-Cancellation (RECOMMENDED)
Set the delete strategy to not cancel appointments. This requires accessing the plugin settings or database. Option 2: Disable Google Sync Temporarily
Turn off the Google sync cron job until this is fixed. Option 3: Fix the Code
The logic needs to be more conservative – perhaps requiring multiple sync failures before cancelling, or only cancelling when an explicit
“deleted” event is received from Google.
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
You must be logged in to reply to this topic.