Page the account-wide lists at 50 per page
Written by @thehalebot
Six account-wide operations in the spec and every SDK assume Basecamp answers them whole. basecamp/bc3#14537 pages all six at 50 records on every page, with a Link: rel="next" header while more remain and X-Total-Count on every page. Five of them were unpaged, so once it ships every SDK would return page 1 as if it were the whole answer. The sixth, the overdue to-dos report, was paged by basecamp/bc3#14519 at 15, 30, 50 and then 100, and #1100 described those sizes. With this PR every SDK follows the pages of the five, and the overdue report's spec and notes describe 50 a page.
Why 50, not 100. This follows bc3#14537's reason. Every API collection that pages at one fixed size already uses 50, among them search, notifications, the activity timeline, bookmarks and bubble-ups, so clients already handle it. The cost per record is flat, about 3 KB and 4,400 allocations a to-do, so 100 would double each request's work: in bc3's measurement the overdue to-dos feed took 280–330 ms at 50 and 560–1,150 ms at 100. 50 halves that work for twice as many requests.
Merge order: merge after basecamp/bc3#14537, which pages these routes on Basecamp's side. basecamp/basecamp-mcp-server#385 and basecamp/basecamp-cli#1044 merge after this.
There is one commit per route, plus one that moves Go's person progress onto the wrapped-page follower the assigned report needed.
What changes for callers
| Route | Operation | Shape | Now |
|---|---|---|---|
GET /todos/overdue.json | GetEverythingOverdueTodos | array | link pagination, page |
GET /cards/overdue.json | GetEverythingOverdueCards | array | link pagination, page |
GET /my/assignments/completed.json | GetMyCompletedAssignments | array | link pagination, page |
GET /reports/timesheet.json | GetTimesheetReport | array | link pagination, page |
GET /reports/todos/assigned/:id.json | GetAssignedTodos | object | wrapped pagination over todos, page |
GET /reports/todos/overdue.json | GetOverdueTodos | object of four arrays | unchanged from #1100: page, no walk |
- Arrays carry the
@basecampPagination(style: "link", maxPageSize: 50)trait, as the other paged lists do. Withoutpage, each SDK still returns every record, one request per 50. A positivepagereturns that page alone. - The assigned to-dos report is the same shape as
GetPersonProgress({person, events}), so it takes the same trait withkey: "todos". Each SDK walkstodosand keeps the first page'spersonandgrouped_by, which bc3 repeats on every page. Its three members are marked@required, as bc3's jbuilder writes all three unconditionally; the Rust generator refuses a wrapped key that may be absent. - The overdue report keeps #1100's surface. Only its doc,
MIGRATING.mdand the page-2 test fixtures change, from the geared sizes to 50. - Go:
EverythingService.OverdueTodosandOverdueCardstakepage int32and return*TodoListResult/*CardListResult.MyAssignmentsService.Completedtakespage int32and returns the new*MyAssignmentListResult.TimesheetService.Reportreturns*TimesheetListResultand honoursLimitandPage, sharing one tail withProjectReportandRecordingReport.ReportsService.AssignedTodostakesAssignedTodosOptions.Pageand its response gainsMeta. - Other SDKs: the generated methods return each SDK's paged list type (
ListResult, Ruby's lazyListEnumerator, Rust's firstPage). Kotlin and Swift return a typedAssignedTodosResultwhere they returned JSON. - Breaking, pre-1.0: every signature above changes with no alias.
MIGRATING.mdhas one Unreleased section covering all five, per SDK.
Invariants
- Without
page, a call returns every record across pages, in order. Go and TypeScript tests for each route serve page 1 with arel="next"link and page 2 without one, and assert two requests and the ids of both pages in order withMeta{TotalCount, Truncated: false}. Python and Ruby cover the overdue feeds. - A positive
pageis one request for that page. A Go test per route asks for page 2, gets a link to page 3, and asserts one request to?page=2withTruncated: true. - The assigned report keeps its wrapper. The Go and TypeScript tests assert
personandgrouped_byfrom page 1 and the to-dos of both pages, withgroup_bycarried into the followed URL. - Filters still reach the wire. The existing overdue filter tests and the timesheet params test pass with
pageadded. - Every new public type is reachable from outside the package. TypeScript's
index.tsre-exports the four new option types. Swift'sPublicAPIConsumerbuildsGetAssignedTodosResponseContentwith its three required members, besideGetPersonProgressResponseContent, now that the model has no zero-argument init. - Generated files match the spec. Regenerated with
make generateat every commit (Swift through theswift:6.2image, since this host has no Swift toolchain). make checkpasses on Go, TypeScript, Python, Kotlin and Rust,rs-denyincluded now thatmainuses jiff. Its four Ruby steps (rb-test, the Ruby conformance runner and its tests, and the YARD half ofcheck-deprecation-parity) didn't run locally, as this host has no Ruby 4, and Swift has no toolchain here; CI covers both.
Rejected Alternatives
- Model the assigned report like #1100's overdue report (a
pagewith no walk). The assigned report has one array beside fields that repeat on every page, which is the wrapped variant SPEC §8 already defines forGetPersonProgress, so callers get every to-do as before. The overdue report's four arrays have no such key, so it stays as #1100 left it.
Further Work
GetTimesheetReportsendsfrom,toandperson_id, which bc3'sReports::TimesheetsControllernever reads (it readsstart_date,end_date,people_ids[]andbucket_ids[]). basecamp-mcp-server builds the request by hand for that reason. This PR leaves the params as they are.- basecamp/basecamp-mcp-server#385 pages the matching tools, pinned to this branch.