Skip to content

Calendar conflict checking via the administrative free/busy API

  • Deciders: Julian Bäume
  • Date: 2026-07-28

Status

Accepted

Amends ADR-0010: supersedes its decision 3 ("no middleware calls on the owner's behalf in the baseline") for free/busy reads. Everything else in ADR-0010 (iMIP delivery, plugin-side reconciliation, the internal interface) stands.

Decision 7 was revisited on 2026-07-29, when the administrative API went into use: the servlet was accepted as an interim source to be removed along with the switch, and stays as a deprecated secondary source instead, because the version floor its removal depends on is a separate decision. Nothing else about the decision changed.

Context

Booking availability should not offer slots the owner is already busy for. Slot derivation runs for unauthenticated bookers: there is no owner session to forward, the service stores no credentials (ADR-0006), and middleware impersonation has no dependable platform mechanism (ADR-0010's context). ADR-0010 therefore deferred free/busy checking until "a middleware free/busy API usable by services" materializes.

That API now exists. App Suite 8.52 adds an administrative free/busy REST API to the calendar for exactly this case: trusted backend services reading a context's free/busy without acting on behalf of a session user. Two preliminary endpoints below /preliminary/chronos/v1/freebusy, protected by HTTP Basic authentication, answer JSON over an explicit from/until range:

  • GET /freebusy/{context}/{user} for a single user, addressed by the numerical internal user identifier.
  • GET /freebusy/{context}?attendees=… for a batch, where each attendee is a user identifier or one of the user's mail addresses.

It answers the same question as the client-facing chronos?action=freeBusy request and reuses its JSON model, reduced to the free/busy periods themselves: the events behind a busy period are never serialized, not even anonymized, so a consumer learns when a user is busy and never why. It is registered unconditionally, so no middleware feature property gates it. Users who restricted their free/busy visibility come back with a warning and no periods instead of an error, and a user that cannot be resolved in a batch gets a warning while the others are still served.

The middleware also exposes an internet free/busy servlet (GET /servlet/webdav.freebusy), built for Outlook's internet free/busy lookups. It is unauthenticated by design, takes whole weeks counted from "now", speaks iCalendar, handles one mail address per request, and is double-gated behind two administrative properties that are off by default. Reviewed with the calendar maintainers of middleware core: it is a legacy compatibility surface, and conflict checking should not be built on it.

Alternatives considered:

  • A plugin-pushed busy-interval cache (the ui-plugin reads the owner's calendars with the owner's session and pushes anonymized intervals to a new endpoint) would allow per-calendar selection and work without any middleware prerequisite, but creates a second store of free/busy data this service does not own, with staleness semantics (intervals only refresh while the owner uses App Suite in a browser) and new push and retention machinery. Rejected: free/busy has one owner, the calendar backend. Finer control over what it exposes belongs in the calendar, not in a shadow copy here.
  • CalDAV free-busy-query requires Basic authentication as the owner, meaning stored owner credentials, ruled out by ADR-0006.
  • Share-link or iCal-feed polling stores capability URLs granting full event detail and depends on sharing being enabled, which is more exposure than free/busy needs.

Decision

  1. The administrative free/busy API is the busy source. Booking queries the single-user endpoint for the page owner over the window it is deriving slots for, with the (context, user) pair it already stores for every owner, and treats the returned periods as blocking. The deployment supplies the endpoint's base address and the service credentials it is called with. Those are the booking service's own credentials, not the owner's, so ADR-0006 still holds.
  2. Conflict checking is per booking page, on/off. A conflict_check_enabled column on appointment_type, exposed as conflictCheck. There is no per-calendar selection: free/busy answers per user, not per calendar, so narrowing it down would have to be a calendar feature first (raised upstream separately). The plugin defaults the setting to on for new pages when the capability is available; the API default is off.
  3. Busy periods join slot derivation through the existing seam. The fetched periods become externalBusyIntervals on SlotDerivationInput: they block like bookings (candidate buffers apply) but carry no buffers of their own and never count toward the daily cap. Free periods are ignored; busy, tentative, and unavailable ones block, as do types the service does not recognize (RFC 5545 says treat unregistered types as busy). The middleware already excludes transparent events and declined invitations.
  4. Fail open, uniformly. One service function owns the semantics: toggle off, no busy source configured, an owner the calendar will not answer for, or any request failure yields "no external busy time" (plus a warning and a booking_freebusy_fetch_total{outcome} counter). A per-user warning in the response is treated as "no periods", which is the same fail-open path. Derivation from the schedule and own bookings is the floor; the availability of the public booking page never depends on the middleware being reachable.
  5. No HTTP inside the booking transaction. The slots listing, the MCP tools, booking creation, and rebook all fetch busy time before entering the per-owner lock and pass it in. The hard no-double-booking guarantee remains the transactional recheck against this service's own bookings; the calendar check is advisory. Rebook subtracts the old booking's own interval from the fetched busy time, because the owner's calendar still holds the old booking's event and an overlapping rebook would otherwise refuse itself.
  6. A short per-owner cache (30 s) bounds the load. The public slots endpoint is unauthenticated; without the cache it would be an amplification vector against the middleware.
  7. The internet free/busy servlet remains as a secondary source, deprecated from 8.52 on. A deployment whose middleware predates 8.52 keeps conflict checking by pointing the freeBusyURL config key at the servlet; the service reads it through the same seam and the same fail-open path, and only while the administrative API above is unconfigured. Wherever the REST API is available it is the discouraged choice, because it carries the servlet's limits: whole weeks counted from "now", two administrative properties that default to off, identification by the mail-address snapshot rather than the stored identity, and an unauthenticated endpoint that has to be kept off the public ingress. The service logs a deprecation warning while the servlet is the active source, so a deployment that has moved to 8.52 without revisiting its configuration is visible instead of merely quiet. Removal is deliberately not scheduled here: it depends on deciding the oldest supported middleware version, which is not this ADR's call.

Consequences

Positive

  • Busy data is current at request time. No sync jobs, no second free/busy store, no staleness bookkeeping.
  • The calendar stays the single authority on what counts as busy. Transparency, classification, and decline handling come for free and stay consistent with every other free/busy consumer.
  • Both sources are answered by the same administrative free/busy path inside the middleware, so switching from the servlet to the REST API does not change which appointments block a slot. The behaviour the e2e suite pins stays valid across the switch.
  • Ranges are requested as the days being derived instead of whole weeks counted from "now", so long booking horizons and single-slot checks cost what they should. Whole days rather than the exact range: one lookup then serves every check landing on the same day, which is what lets the short cache bound load from the unauthenticated slots endpoint — booking creation checks a single slot, so exact ranges would mean one middleware request per attempted start.
  • The owner is addressed by the (context, user) identity booking already holds, so the check no longer depends on the mail-address snapshot being present and current.
  • The endpoint returns periods only and never the events behind them, so this service learns when the owner is busy and never why. Nothing about event content can leak through a booking page.
  • No middleware feature property has to be switched on, and no unauthenticated middleware surface has to be published, for booking to work.
  • Bookings and rebooks, including those made through the MCP endpoint, share one code path.

Negative / constraints

  • The endpoints are preliminary, so their path and payload can change before they settle. The client stays behind the same seam as the servlet client to keep that a local change.
  • The deployment has to give booking the endpoint address and service credentials. This keeps owner credentials out of the service, but it is a prerequisite the service cannot arrange alone.
  • Free/busy visibility remains the owner's own choice: a user who restricted it is reported with a warning and no periods, so the check silently finds nothing to block. A deployment that defaults the setting to anything other than "everyone" makes conflict checking blind for its users.
  • The owner's merged availability is used as-is: unanswered invitations block slots, and owners cannot exclude individual calendars from the check.
  • Calendars subscribed from other providers do not participate. The administrative path reads the internal calendar storage, while the owner's own scheduling view aggregates every free/busy provider, so a time can look busy there and still be offered on the booking page. The product documentation states this.
  • A booking confirmed here also appears in the owner's calendar once accepted, so its time is blocked twice (by the booking row and by free/busy). Harmless for availability; rebook handles the one case where it matters.

References