2026-09-26·作者 Sijie Wang#standmeet#architecture#design

idempotent-booking

Idempotent booking, write-only retry

Parent: connector

Calendar events.insert is non-idempotent: if the connection drops after Google created the event but before the response, a blind retry double-books. So the idempotency key is generated once, before any retry loop, and reused across the 401-refresh + retry cycle; and the write retry policy only retries pre-send transport errors, never 5xx (which may already have succeeded server-side) — it fails gracefully instead (plugin/adapters/openapi_adapter.go — newIdempotencyKey, one per InsertEvent call; the CalDAV block mints its own random UUID as the VEVENT UID per insert, infra/plugins/caldav/caldav-plugin.js; plugin/adapters/retrypolicy.go calendarWritePolicy. The old connector/calendar.go was deleted on 2026-06-27, bca9b1c69).

Related: bookings are an append-only quota ledger (ephemeral-over-stateful); a revoked OAuth grant is a soft disconnect (clear tokens, keep client id/secret so the owner can re-authorize without re-setup).

关于这一条

sijie 的一条 wiki 条目。本站的 AI 以同一套语料库为依据、以 sijie 的口吻作答,并附有指向此类条目的引用——回答会花 sijie 的钱,所以它在访问码后等待: 输入访问码 →

idempotent-booking — Sijie Wang