Repository navigation
fix(calendar): expand offset-only recurring events in the calendar's zone - #1310
saariuslystoned wants to merge 5 commits into
Conversation
…zone Google expands a recurring event in start.timeZone. When --from/--to carry only an offset, create and focus-time sent a fixed Etc/GMT zone, so the series kept that offset across daylight saving changes, or no zone at all for half-hour offsets such as +05:30, which Google rejects with "Missing time zone definition for start time". Use the calendar's IANA zone when it has the same offset at that instant. Explicit timezone flags, UTC, all-day dates and single events are unchanged. An offset that still has no zone in calendar create is a usage error naming --timezone. The calendar lookup is cached on the mutation context, so the command still reads the calendar once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codex review: needs real behavior proof before merge. What this changesThis PR uses a matching calendar timezone for offset-only recurring events and rejects unresolved fractional offsets during creation. Example: Create a weekly 09:00 event on an America/Los_Angeles calendar using 2026-11-10T09:00:00-08:00.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR addresses a current recurring-event failure; the previous diagnostic finding is fixed, but changing the deliberate fixed-offset default still needs a calendar owner's decision. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherCalendar CLI commands build event payloads from datetime flags, resolve calendar metadata through the authenticated Calendar service, and insert events through Google's API. flowchart TD
A[Calendar CLI flags] --> B[Event planning]
B --> C[Offline dry run]
B --> D[Recurring timezone resolution]
E[Calendar timezone metadata] --> D
D --> F[Calendar event insert]
F --> G[Formatted event output]
Technical reviewBest possible solution: Preserve the explicit timezone contract and add actionable validation for unresolved recurring offsets unless the calendar owner approves automatic regional expansion. Do we have a high-confidence way to reproduce the issue? Current-main source omits timezone metadata for fractional offsets, and the contributor's live CLI output demonstrates Google's rejection; no target code or tests were run during this read-only review. Is this the best way to solve the issue? The implementation shares resolution between create and focus-time and preserves explicit flags, but automatically selecting a region exceeds the narrow validation repair and changes an intentional default. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8428c36dd31. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed November 9, 2026, 1:34 AM ET / 06:34 UTC (Revision 4). |
A recurring create or focus-time with offset-only times sends the calendar's zone when it matches, but --dry-run stays offline and showed the fallback Etc/GMT zone as if it were final. Add a recurring_timezone_lookup entry with the offset, the rule and the fallback to both dry-run plans. The create plan now carries the explicit timezone flags it resolved, and Run reuses them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review.
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…y set --timezone cannot be combined with --start-timezone or --end-timezone. When one endpoint already has its own zone, the unresolved-offset error and the dry-run plan now name the other endpoint's flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Closing to keep the existing fixed-offset recurrence default. A narrower error-reporting change can come separately if it's wanted. |
What problem this solves
For a recurring event, Google needs
start.timeZoneandend.timeZoneas IANA names. The Events reference says the field "is required and specifies the time zone in which the recurrence is expanded".docs/dates.mdtells agents to pass an explicit offset, andcalendar create --from/--totakes RFC3339 only. When that offset is the only zone information,extractTimezonepicks the zone:Etc/GMT±Nzone (since calendar: avoid ambiguous timezone inference from offsets #492). Google expands the series in that fixed zone, so a weekly 09:00-08:00meeting created in November moves to 10:00 local time once US daylight saving starts in March. The same happens in every zone with daylight saving.Etc/GMTzone, so notimeZoneis sent. This covers+05:30(India),+09:30/+10:30(Adelaide),+05:45,+03:30and-03:30. The recurring insert then fails with400 required: Missing time zone definition for start time, the error reported live in Recurring Events Fail with "Missing time zone definition" Error #216 and Bug: Missing time zone definition for start time when creating recurring events #347. fix(calendar): preserve RRULE and set timezone for recurring updates #392 fixed the update path by reusing the event's stored zone; create still sends no zone for these offsets.calendar focus-time --rrulebuilds its times the same way and has both problems.Change
When a
calendar createorcalendar focus-timeevent has--rruleand a time carries only an offset, gog checks the target calendar's time zone. If that zone has the same offset at the given instant, gog sends the calendar's IANA name. ThedateTimeis unchanged, so the first occurrence keeps the same instant and later occurrences keep its local time. This only uses a zone the calendar already has. It doesn't guess between regions that share an offset, which was the concern in #492.Unchanged:
--timezone,--start-timezoneand--end-timezoneZ,+00:00)Etc/GMT±NIf an offset still has no zone after the check (for example
+05:30on a UTC calendar),calendar createreturns a usage error that names--timezonebefore inserting anything, instead of sending a request Google rejects.focus-timehas no timezone flag, so it keeps sending the request as before.writeEventalready calledCalendars.Getafter every create to format its output. The lookup is now cached on the mutation context, so a recurring create still makes one calendar read.--dry-runstill makes no API calls. When a recurring event's time carries only an offset, the dry-run request now adds arecurring_timezone_lookupentry forstartandend. Each entry gives the offset, the rule ("use the calendar's time zone if it has this offset at dateTime") and the fallback: theEtc/GMTzone, the usage error asking for--timezone, or for focus-time "no time zone is sent". The preview no longer presents the fallback zone as final. Explicit timezone flags and UTC times need no lookup and get no entry.Evidence
internal/cmd/calendar_recurring_timezone_test.godrivesCalendarCreateCmdandCalendarFocusTimeCmdagainst anhttptestCalendar server and checks the inserted event:-08:00with aAmerica/Los_Angelescalendar+05:30withAsia/Kolkata+05:30with a UTC calendar, which must return the usage error with no insertZwith aEurope/Londoncalendar, which keepsUTC--start-timezone, which keeps the explicit zoneFive fail on
main(e8428c3) and pass with this change.TestCalendarCreateCmd_DryRunDeclaresRecurringTimezoneLookupandTestCalendarFocusTimeCmd_DryRunDeclaresRecurringTimezoneLookupcover the dry-run entry, including no entry with--timezone. A sixth test pins single events toEtc/GMT+8, and the existingTestCalendarCreateCmd_RecurringOffsetTimezoneFallback(+02:00on a UTC calendar staysEtc/GMT-2) still passes.A built
bin/gogfrommainand from this branch was run against a local Calendar stand-in throughGOG_GOOGLE_API_BASE_URL, with an emptyGOG_HOMEand the file keyring. The stand-in is not Google. It servescalendars/primarywith a chosen zone, and it answers a recurring insert that has nostart.timeZonewith the 400 from Bug: Missing time zone definition for start time when creating recurring events #347:Live Google Calendar runs on throwaway secondary calendars in a Workspace account, deleted afterwards.
mainisgogbuilt from e8428c3; the branch build contains this change. Values are as Google returned them:When
--start-timezoneor--end-timezonealready sets one endpoint's zone, the unresolved-offset error and the dry-run plan now name the other endpoint's own flag. Suggesting--timezonethere failed, because it cannot be combined with them.TestCalendarCreateCmd_RecurringUnresolvedEndSuggestsGranularFlagcovers a UTC calendar with--start-timezone Asia/Kolkataand+05:30times. It fails on the previous head 42d6607 (the error sayspass --timezone) and passes on 0690277 (the error sayspass --end-timezone).CI on 0690277:
go test -count=1 ./...ran on a second macOS arm64 machine. In that run,internal/secretsTestRekey_Permissionsfailed once and every other package passed. The failure did not reproduce: on 0690277 the test then passed on that machine, three times alone and once with its whole package, and it passed locally at both 0690277 and e8428c3. This change does not touchinternal/secrets.Boundary: the live runs above cover
calendar create.calendar focus-timeuses the same helper and is covered by the tests only.🤖 Generated with Claude Code