Repository navigation
fix(calendar): read further event pages up to --max in search and team - #1322
saariuslystoned wants to merge 3 commits into
Conversation
events.list may return fewer events than maxResults together with a nextPageToken. calendar search and calendar team read one page and dropped the token, so later matches were silently missing. Read pages until --max events are collected or the listing ends, and note on stderr when calendar search stops with more matches remaining. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesRead successive Calendar event pages up to the existing --max limit in search and team commands. Example: calendar search standup --max 50 receives event1 and token p2, followed by event2.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current Calendar pagination defect and remains necessary; the focused patch has no actionable correctness findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCalendar search queries one calendar and team queries member calendars; API pages feed existing redaction, filtering, deduplication, and JSON or text output. flowchart TD
A[Calendar CLI commands] --> B[Calendar service client]
B --> C[Bounded event paging]
C --> D[Google Calendar API]
D --> C
C --> E[Filtering and redaction]
E --> F[JSON or text output]
Technical reviewBest possible solution: Use the shared bounded paging helper while preserving existing limits, filtering, redaction, and output contracts. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically discards later pages after a short response with a continuation token, consistent with the supplied before/after CLI traces; no target code was run during this read-only review. Is this the best way to solve the issue? The focused helper fixes the shared pagination cause while retaining command-specific behavior; existing all-pages collectors would not preserve the total-event limit. 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. Review metrics
LabelsLabel changes:
Label justifications:
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 (1 earlier review cycle)
Reviewed November 9, 2026, 11:33 AM ET / 16:33 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thank you for the fix. I reproduced the claim and consolidated reading short event pages until the requested Calendar search/team limit into #1336, with regression coverage and your coauthor credit retained. The full |
What problem this solves
calendar searchandcalendar teammake oneevents.listcall and dropnextPageToken. The events.list reference says a page can hold fewer events thanmaxResults, "or none at all, even if there are more events matching the query". Incomplete pages are marked by a non-emptynextPageToken. Matches past the first page are therefore silently missing:calendar searchneither pages nor shows the token in JSON or text output, so a short page looks like the complete result.calendar events, which uses the same API, surfacesnextPageToken.calendar teamreads one page per member calendar. Its client-side--queryfilter then runs on that page alone, so a member's matching event on page 2 never appears in the merged view.Change
listCalendarEventsUpToreadsevents.listpages until it has--maxevents or the listing ends. It asks only for the events still needed and stops on a repeated page token.calendar searchuses it. When it stops at--maxwith more matches left, it prints a stderr hint,# More results: raise --max (currently N) …, in the style of the existing next-page hints.calendar teamuses it per member calendar.--maxkeeps its meaning of "max events per calendar".Evidence
Tests in
internal/cmd/calendar_events_paging_test.gouse anhttptestevents.listthat returnsevent1withnextPageToken: p2, thenevent2:TestCalendarSearch_ReadsLaterPagesUpToMax(--jsonand--plain,--max 50): onmain(e8428c3) onlyevent1is printed. With this change both appear, with no hint.TestCalendarSearch_StopsAtMaxAndSaysMoreRemain(--max 1): one request, onlyevent1, and the stderr hint.TestCalendarTeamEvents_ReadsLaterPagesPerCalendar: onmainthe team view lists onlyevent1. With this change it lists both.The existing calendar search, team and events tests pass.
Built
gogbinaries frommainand from this branch were run against a local Calendar stand-in throughGOG_GOOGLE_API_BASE_URL. The stand-in is not Google: it returnsevent1withnextPageToken: p2, thenevent2. The output below shows each binary's events.list requests:Every
make cistep passed on3cdb086(go1.27.3); the headdbf8b18only adds this PR's number to the CHANGELOG entry. The Go test suite ran on a second macOS arm64 machine, and the fmt, lint, deadcode, docs, agent-skills and node checks ran locally.☁️
🤖 Generated with Claude Code