Skip to content

fix(google): don't default-enable colleagues' shared calendars - #377

Merged
KrisBraun merged 1 commit into
mainfrom
fix-google-calendar-default-channels
Aug 5, 2026
Merged

fix(google): don't default-enable colleagues' shared calendars#377
KrisBraun merged 1 commit into
mainfrom
fix-google-calendar-default-channels

Conversation

@KrisBraun

Copy link
Copy Markdown
Contributor

Summary

The Google Calendar connector picked which calendars to sync by default using accessRole === "owner" from the Calendar API. That field is an ACL permission tier, not an ownership signal — a workspace's internal calendar-sharing defaults (or a teammate sharing their own calendar for scheduling coverage) can grant "owner"-level access on a calendar that isn't actually yours. In a workspace with generous internal sharing, every colleague's personal calendar reads accessRole: "owner" too, so they all got swept into the default-enabled set alongside the user's own calendar — flooding the connection with other people's events.

Change

  • Default-enable decision now uses the calendarList primary flag, which Google guarantees is true for exactly one calendar per user: their own. Other calendars (colleagues', shared team calendars, subscriptions) are still listed and can be enabled manually — just no longer pre-selected.
  • Updated the Channel.enabledByDefault doc comment in the Twister SDK, which had cited the old accessRole check as the reference example for other connectors to follow.
  • Added regression tests covering: own primary calendar enabled, a colleague's owner-ACL calendar NOT enabled, a non-owned shared/subscribed calendar NOT enabled, and the no-CALENDAR_LIST_SCOPE fallback.

Test plan

  • pnpm exec tsc --noEmit in connectors/google — clean
  • pnpm exec vitest run in connectors/google — 363/363 passing (including 4 new tests)
  • pnpm lint in connectors/google and twister — clean
  • pnpm validate-changesets — valid

🤖 Generated with Claude Code

https://claude.ai/code/session_017vzBsQy8oMtks73MLJ49Jz

The Google Calendar connector previously used accessRole === "owner"
to decide which calendars to sync by default. That field is an ACL
permission tier, not an ownership signal: a domain's internal calendar
sharing defaults (or a teammate sharing their own calendar for
scheduling coverage) can grant "owner"-level access on a calendar that
isn't actually the user's own. In a workspace with generous internal
sharing, every colleague's personal calendar would read
accessRole: "owner" and get swept into the default-enabled set
alongside the user's own calendar.
Now the default-enable decision uses the calendarList `primary` flag
instead, which Google guarantees is true for exactly one calendar per
user: their own. Colleagues' and shared team calendars are still
listed and can be enabled manually — they're just no longer
pre-selected.
Also updates the `Channel.enabledByDefault` doc comment, which cited
the old accessRole check as the reference example for other
connectors to follow.
@KrisBraun
KrisBraun merged commit 2e00d59 into mainAug 5, 2026
1 check passed
@KrisBraun
KrisBraun deleted the fix-google-calendar-default-channels branch August 5, 2026 23:22
@plot-app-builderplot-app-builderBot mentioned this pull request Aug 5, 2026
Sign up for freeto 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

@KrisBraun