Fix Google Calendar scheduling over Focus Time and Out of Office events (#50605)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves
https://github.com/fleetdm/fleet/issues/50548

Fleet's calendar integration was scheduling maintenance events over
users' **Focus Time** and **Out of Office** blocks, even when those were
marked Busy.

The root cause is the event query in `ListEvents`
(ee/server/calendar/google_calendar.go), which only requested
`"default"` event types — so `focusTime` and `outOfOffice` events were
never returned and never considered during conflict detection.

## Change
Added the blocking event types to the query:

```go
EventTypes("default", "focusTime", "outOfOffice").
```

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.

---------

Co-authored-by: Lucas Manuel Rodriguez <lucas@fleetdm.com>
This commit is contained in:
Harrison Ravazzolo
2026-08-06 15:05:30 -03:00
committed by GitHub
co-authored by Lucas Manuel Rodriguez
parent 133e4a3832
commit 32802c5731
2 changed files with 2 additions and 1 deletions
@@ -0,0 +1 @@
- Fixed the Google Calendar integration scheduling maintenance events over users' Focus Time and Out of office blocks.
+1 -1
View File
@@ -197,7 +197,7 @@ func (lowLevelAPI *GoogleCalendarLowLevelAPI) ListEvents(timeMin, timeMax string
}
// Default maximum number of events returned is 250, which should be sufficient for most calendars.
return lowLevelAPI.service.Events.List(calendarID).
EventTypes("default").
EventTypes("default", "focusTime", "outOfOffice").
OrderBy("startTime").
SingleEvents(true).
TimeMin(timeMin).