fix(calendar): use Calendars.Get for TZ lookup to fix SA 404#325
Open
markwatson wants to merge 1 commit intosteipete:mainfrom
Open
fix(calendar): use Calendars.Get for TZ lookup to fix SA 404#325markwatson wants to merge 1 commit intosteipete:mainfrom
markwatson wants to merge 1 commit intosteipete:mainfrom
Conversation
Author
|
Note: I accidentally opened this PR previously, but it wasn't tested enough. Now that I've tested it, I opened a new PR to keep the branch naming consistent (fix/...), instead of reopening the existing one. Apologies for the noise. |
markwatson
commented
Feb 18, 2026
Comment on lines
+34
to
+35
| // Uses Calendars.Get (not CalendarList.Get) so it works for service accounts | ||
| // whose "primary" calendar may not appear in their CalendarList. |
Author
There was a problem hiding this comment.
These comments are probably unnecessary - I can remove them if needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @steipete,
When using with a service account, I ran into some 404s when running:
gog calendar list email@example.com(or events). This was true even whengog calendar calendarsdid in fact return a couple calendars.It appears this is an issue with how service accounts manage their list of calendars. In time_helpers.go, we call CalendarList.get(calendarID):
But svc.CalendarList doesn't contain the calendar for the service account, so it fails. Instead this change will use
svc.Calendars.Getin order to always be able to lookup the calendars. I'm unsure what exactly controls this list for service accounts, but in my case I somehow had the calendars in the list, and then suddenly didn't. The documentation I found for the differences is here. There's also a similar change for the time zone helper.I also manually retested this using the existing OAuth / standard flow documented in the README, and it appears to still
work. I would expect something similar to happen with the CalendarCalendarsCmd usage of svc.CalendarList.List(), but in my testing that did not seem to be the case.
Please let me know if I can change / improve any of this. I know it's a slight change, so if it's not something you want to do I won't mind. I needed the code for a project I was working on, so figured I would share it in case it's useful to others.
Thanks!
Mark