cli icon indicating copy to clipboard operation
cli copied to clipboard

calendar +agenda silently returns incomplete results

Open laudney opened this issue 3 months ago • 1 comments

Summary

gws calendar +agenda says that it shows events across all calendars, but it can silently omit calendars and events.

At commit a3768d0e82ad83cca2da97724e46bea4ff0e6dbd:

  • The helper reads only the first calendarList page and ignores nextPageToken: https://github.com/googleworkspace/cli/blob/a3768d0e82ad83cca2da97724e46bea4ff0e6dbd/crates/google-workspace-cli/src/helpers/calendar.rs#L261-L289
  • Each calendar request hard-codes maxResults=50 and ignores the event nextPageToken: https://github.com/googleworkspace/cli/blob/a3768d0e82ad83cca2da97724e46bea4ff0e6dbd/crates/google-workspace-cli/src/helpers/calendar.rs#L322-L359
  • A request error, non-success response, or JSON decode error is converted to an empty event list: https://github.com/googleworkspace/cli/blob/a3768d0e82ad83cca2da97724e46bea4ff0e6dbd/crates/google-workspace-cli/src/helpers/calendar.rs#L334-L356

This makes a partial result indistinguishable from a complete agenda with no events.

Reproduction

  1. Put more than 50 matching events in one calendar within the requested range.
  2. Run gws calendar +agenda for that range.
  3. The output contains at most 50 events from that calendar and reports no truncation.

A provider error for one secondary calendar also produces a successful result that omits that calendar.

Expected behavior

  • Follow nextPageToken for calendarList.list and every events.list request until it is absent.
  • Do not convert per-calendar failures into empty calendars. Return an error, or return an explicit partial-result status with the failed calendar and cause.
  • If the command has an intentional caller limit, expose the limit and report that the result is truncated.

laudney avatar Aug 19 '26 06:08 laudney

Can i work on this issue?

manrods avatar Aug 21 '26 13:08 manrods