Skip to content

fix(google-calendar): convert ISO offsets to UTC wall time - #13528

Merged
kodjima33 merged 2 commits into
BasedHardware:mainfrom
Nukeys:fix/gcal-iso-offset-to-utc
Sep 12, 2026
Merged

kodjima33 merged 2 commits into
BasedHardware:mainfrom
Nukeys:fix/gcal-iso-offset-to-utc

Conversation

@Nukeys

@Nukeys Nukeys commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #13149.

ISO datetimes with an explicit offset are converted to UTC before tzinfo is dropped, so timeZone: UTC does not shift the instant.

Failure-Class: none

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread plugins/omi-google-calendar-app/main.py Resolved
@Nukeys

Nukeys commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Fixed: the %Y-%m-%dT%H:%M:%S%z strptime path also converts aware results to UTC wall time before returning.

@Nukeys

Nukeys commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks; no further action on this PR.

@Git-on-my-level

Copy link
Copy Markdown
Member

Nice, surgical fix for #13149 — and credit to @kaijakagi-sys for the precise root-cause analysis in the issue. Normalizing to UTC wall time inside parse_datetime is the right seam, since all four call sites (tool_create_event and tool_update_event in plugins/omi-google-calendar-app/main.py) attach timeZone: "UTC" to the isoformat() string.

I ran the parse_datetime from this branch in a clean isolated environment:

input result (naive UTC)
2026-09-09T14:00:00+05:30 (strptime %z branch) 2026-09-09 08:30:00 — correct
2026-09-09T14:00:00.123+05:30 (#13149 repro, fromisoformat fallback) 2026-09-09 08:30:00.123000 — was 14:00:00.123 before, off by 5.5h
2026-09-09T14:00:00-07:00 2026-09-09 21:00:00 — correct
Z, +0000, and no-offset inputs unchanged

Relative dates ("tomorrow"), time-only ("14:30"), date-only/all-day, and invalid inputs all behave exactly as before, and the except: → except Exception: cleanup is a good touch.

Two non-blocking notes:

  1. Pre-existing, not from this PR: fractional-second Z (e.g. 2026-09-09T14:00:00.123Z) still fails to parse, because dt_str.strip().lower() (line 172) lowercases the Z before dt_str.replace("Z", "+00:00") (line 228) can match, and fromisoformat rejects a lowercase z. Non-fractional Z survives via the strptime formats. A one-word follow-up (replace("z", "+00:00")) would close it.
  2. parse_datetime is now a pure, easily-testable function guarding a real bug class — if this plugin ever gets a test file, positive/negative/fractional offsets plus the all-day and relative cases would be the first things I'd pin down.

This plugin path has no CI checks configured, so nothing but review gates it — leaving the merge call to a maintainer.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added python positive-signal Automation verified a genuine fix/quality contribution labels Sep 12, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Owner/community bug-fix fast lane 4/5: confirmed the ISO-offset-to-UTC gap isn't on main; scoped fix, verified correct.

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

Labels

positive-signal Automation verified a genuine fix/quality contribution python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Google Calendar plugin: fractional-second timestamps lose their explicit UTC offset

3 participants