Repository navigation
feat(runtime-ts): default list page size of 50 when no limit is given - #640
Merged
Merged
Conversation
A generated entity or projection list in a project that sets no `api.pagination` returned every matching row when the request carried no `limit`. It now answers the first 50 (DEFAULT_PAGE_LIMIT in metadata), the default of every port; an explicit `limit` is still served as asked, since there is no maximum without the setting. A project that sets the block is unchanged. - pageLimit returns the default when there is no page size, on the Fastify, Hono and ObjectManager mounts and on projection lists. - The OpenAPI document states the default (and no maximum) when the project sets no page size; contract-conformance goldens regenerated. - The `meta verify` advisory `unbounded-list-pages` is retired. - New shared scenario api-contract list-query/default-page-of-fifty over the 60-row seed; counts updated. - Docs: api-contract, language differences, CHANGELOG, and an upgrade guide (docs/features/migrations/default-list-page-of-fifty.md). Owned example runtime copies and the site payload resynced.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
limitnow returns 50 rows on the TypeScript runtime. This covers the Fastify, Hono and Drizzle-Fastify mounts, including the read-only mounts used for projections. An explicitlimitstill has no maximum unlessapi.paginationsets one. The default constant lives inmetadata/src/api-pagination.ts. The ejecteddrizzle-fastifyruntime copies inexamples/advanced-modelingandexamples/showcaseare updated to match.codegen-tsbuild-openapi.tsandapi-surface.ts) now documents the default of 50 on list endpoints, and thefixtures/contract-conformance/*/expected/openapi.jsonsnapshots are regenerated. A new shared scenario,fixtures/api-contract-conformance/list-query/scenarios/default-page-of-fifty.yaml, pins the behaviour for every port. Runtime tests cover the Fastify, Hono and Drizzle-Fastify read-only and list mounts.unbounded-list-pagesverify advisory is retired from the TypeScript CLI:pagination-advisory.tsand its test are deleted, and theverifyandadvisorywiring is removed.meta initscaffolding and its test are updated. The Java, Python and C# advisories are untouched. The docs gain aCHANGELOG.mdentry, edits to the conformance, api-contract, contract-emitters and language-differences pages, and an upgrade note atdocs/features/migrations/default-list-page-of-fifty.md.Validation
Risk Assessment
Testing
Baseline regression came from the configured
scripts/ci-local.sh --affected --strict-toolchains, which passed. I ran focused runtime tests for the entity, projection and ObjectManager mounts, the contract openapi snapshots andmeta inittests. All passed. A mutation that restored unbounded lists failed 6 tests, including the new projection and ObjectManager cases, so the tests would catch a regression.meta initreflect the default of 50Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
server/typescript/packages/runtime-ts/test/list-page-size.test.ts:109- No runtime or shared-corpus test exercises the new 50-row default on the projection list mount or on the ObjectManager (fastify/index.ts) mount. The intent names 'entity and projection lists'.list-page-size.test.tscovers only the drizzle-fastify and hono entity mounts (listBehaviour(...)at lines 109 and 127).default-page-of-fifty.yamlhits/api/parts, an entity. The projection mounts (drizzle-fastify/mount-read-only.ts:241,hono/mount-read-only.ts:210) and the ObjectManager mount (fastify/index.ts:156) callpageLimitunchanged. A regression there, such as one returning to unbounded, would pass every test. Add a no-api.paginationcase with more than 50 rows to the read-only mount tests (test/drizzle-fastify/mount-read-only.test.ts) and to the ObjectManager mount tests. Expect 50 rows by default and all rows when an explicit largelimitis sent.🔧 Fix applied.
📝 1 wording or comment-placement note left for the author (no fix round spent):
docs/features/migrations/default-list-page-of-fifty.md:22- Migration doc namedmeta eject runtime, which is not a command. The runtime copy undercodegen/runtime/comes from ejectingroutesorroutes-hono(docs/features/own-your-codegen.md). I changed the text inline tometa eject routes/routes-honoandmeta eject routes --force.✅ **Test** - passed
✅ No issues found.
meta initreflect the default of 50scripts/ci-local.sh --affected --strict-toolchainsBaseline:scripts/ci-local.sh --affected --strict-toolchainsalready passed at target commitbun testin runtime-ts: list-page-size, drizzle-fastify/mount-read-only, hono/mount-read-only, fastify/mount-list-parity (88 pass)bun test test/contractin codegen-ts (326 pass, openapi snapshots)bun test test/init.test.tsin cli (71 pass)Mutation check: reverted pageLimit default to unbounded, 6 tests failed across all mounts, then restored the source (clean tree)grep: no unbounded-list-pages remains in TS source; only docs for other ports and the changelog mention it✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.