From 7d2d38c8483e4da74d05c0f6d8bbd8650bc01171 Mon Sep 17 00:00:00 2001 From: Barely Removable Date: Thu, 3 Sep 2026 09:21:53 -0700 Subject: [PATCH] Document mode:single -> parallel fix on the HA automation The fix itself lives entirely in HA config (automation.lunch_menu_family_calendar), not in this repo, so there's nothing to redeploy here -- this just records what broke and why, for the next time someone (human or Claude) is debugging why calendar events aren't showing up. Root cause: mode: single (HA's default) let only one webhook-triggered run execute at a time; a week push fires 5 POSTs back-to-back, so 4 of 5 got rejected as failed_single and only one day's event was ever created. Switched to mode: parallel and verified all 5 days land correctly now. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01KsJqAZ82Veyf5oihBr71S5 --- CLAUDE.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 2555812..438fb6c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -55,7 +55,19 @@ commits), they describe the pre-2026-09-03 app, not the current one. `delete_event` — a bad push can't be cleaned up via the HA API, only manually in Google Calendar. No duplicate-prevention: re-pushing the same date's menu creates a second event — this is why the default - schedule is a single day/week, not daily (see below). The webhook id is + schedule is a single day/week, not daily (see below). + **`mode: parallel`, not the default `single` (fixed 2026-09-03 after a + real bug):** a week push fires one webhook POST per school day + back-to-back with no delay. Under `mode: single`, HA rejects any + webhook trigger that arrives while a previous run is still executing + (`calendar.create_event` itself takes ~600-700ms) — 4 of every 5 days + were silently dropped as `failed_single`, so only one day's event ever + actually got created per week push. Found via `ha_get_automation_traces` + after the user reported a manual test push not showing up on the + calendar. Each invocation is independent (one `calendar.create_event` + call, no shared state), so `parallel` is the correct mode per HA's own + guidance ("independent per-entity actions → parallel"), not just a + workaround. The webhook id is a random token that lives only in the server's `.env` (`HA_WEBHOOK_URL`) and in the automation's trigger config — never committed here. If the calendar push stops working, check both ends: `GET /api/integrations`