Skip to content

fix(calendar): Loading calendars from service account#321

Closed
markwatson wants to merge 1 commit intoopenclaw:mainfrom
markwatson:fix_service_account
Closed

fix(calendar): Loading calendars from service account#321
markwatson wants to merge 1 commit intoopenclaw:mainfrom
markwatson:fix_service_account

Conversation

@markwatson
Copy link
Copy Markdown
Contributor

@markwatson markwatson commented Feb 18, 2026

Note: This change needs to be rebased against upstream:main, but right now main is broken so it's tested with service accounts on v0.11.0.

use Calendars.Get instead of CalendarList.Get for timezone lookup
CalendarList.Get("primary") returns 404 for service accounts because the SA's own primary calendar is not in its CalendarList, even though Calendars.Get("primary") and Events.List work fine.

Switch getUserTimezone() and getCalendarLocation() to use svc.Calendars.Get(), which works for both OAuth users and service accounts. Update test mocks to match the new endpoint.

…zone lookup

CalendarList.Get("primary") returns 404 for service accounts because
the SA's own primary calendar is not in its CalendarList, even though
Calendars.Get("primary") and Events.List work fine.

Switch getUserTimezone() and getCalendarLocation() to use
svc.Calendars.Get(), which works for both OAuth users and service
accounts. Update test mocks to match the new endpoint.
@markwatson markwatson closed this Feb 18, 2026
@markwatson markwatson deleted the fix_service_account branch February 18, 2026 20:24
@markwatson
Copy link
Copy Markdown
Contributor Author

I opened this PR a little prematurely - sorry (meant to leave it as a branch in my fork). I haven't gone back and reviewed the code / validated for existing use cases with "normal" accounts. The root cause was the calendar listing by ID was failing when using a GCP service account.

@markwatson
Copy link
Copy Markdown
Contributor Author

The root cause is that calendars on service accounts don't have a default, which is causing the TZ issues. TODO: look into if this can be configured, and it's just a user error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant