Skip to content

calendar create --reminder popup:0m fails with "Missing override reminder minutes" (minutes=0 likely omitted in JSON) #302

@komichi32k

Description

@komichi32k

Hi! First off, thank you for gog—it’s been super useful.

Summary

When creating a Google Calendar event with a custom reminder of 0 minutes (i.e., "at start time"), gog calendar create fails with:

Google API error (400 required): Missing override reminder minutes.

Repro

gog calendar create <calendarId> \
  --account <account> \
  --summary "Reminder 0m test" \
  --from 2026-02-17T17:00:00+09:00 \
  --to   2026-02-17T17:00:00+09:00 \
  --reminder popup:0m

Expected

Event is created with an override reminder at exactly start time (0 minutes).

Actual

Command fails with 400:
Missing override reminder minutes.

Notes / Investigation

Looking at internal/cmd/calendar_build.go:

  • parseDuration() allows 0 (range is 0-40320 minutes)
  • buildReminders() builds calendar.EventReminder{ Minutes: minutes }, but when minutes == 0, the generated JSON likely omits the minutes field (Go zero-value / omitempty behavior), so the Google Calendar API receives an override reminder without minutes, and rejects it.

In contrast, using popup:1m works fine.

Possible fix

Force-send minutes when it is 0, e.g. set ForceSendFields: []string{"Minutes"} on calendar.EventReminder when minutes == 0 (or always).

Happy to test a patch if you’d like.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions