Uh oh!
There was an error while loading. Please reload this page.
test(data-objectstack): re-point v3-compat's vacuous PaginatedResult block at real ObjectStackAdapter.find() - #4717
Conversation
…block at ObjectStackAdapter.find() The `PaginatedResult API` block asserted only on an inline object literal it constructed itself, with no import from `./index` or anywhere else in the package — it could not fail in a way that signalled anything about production code (objectui#4712). No interface or export named `PaginatedResult` exists anywhere in packages/. The real production shape is `QueryResult<T>` (packages/types/src/data.ts), returned by `ObjectStackAdapter.find()` via the private `normalizeQueryResult()`, whose total/hasMore/page/pageSize computation had zero coverage anywhere else in this package. The block now drives `ObjectStackAdapter.find()` through a mocked transport and asserts on its real returned QueryResult, including the hasMore fallback and the page calculation from $skip/$top. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnQd8iMMUwXQEV1crFmQiQ
The latest updates on your projects. Learn more about Vercel for GitHub. |
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
commented
Aug 15, 2026
Review verdict: ACCEPT (reviewer of record, PM session Verified against this PR, not the report: two changed files, Will flip ready + enable auto-merge once Lint, Type Check, and Test shards 1–4 conclude Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#4712
What was wrong
packages/data-objectstack/src/v3-compat.test.ts'sPaginatedResult APIblock asserted only on an inline object literal it constructed itself, with no import from./indexor anywhere else in the package:This passes unconditionally regardless of what production code does — it is unreachable from any real query path and cannot fail in a way that signals anything about the codebase (dormant/tautological coverage).
Measurement (route A vs B)
grep -rn "PaginatedResult"underpackages/finds no interface, type, or export literally namedPaginatedResultanywhere in this repo (only prose hits inCHANGELOG.mdreferencing an old upstream@objectstackv3.0.0 migration note).QueryResult(generic over T), exported from@object-ui/types(packages/types/src/data.ts:109) with exactly thedata/total/page/pageSize/hasMorefields the literal hand-copied.QueryResultis returned byObjectStackAdapter.find()(packages/data-objectstack/src/index.ts:1418), via the privatenormalizeQueryResult()(index.ts:2565), which computestotal(total ?? count ?? records.length), thehasMorefallback (prefers the server'shasMore, elserecords.length === $top), andpage(floor($skip / $top) + 1).queryDataset.test.tsandlistViews.test.ts(cited by the issue) exercise other parts of the adapter's return shape but nevertotal/hasMore/page/pageSizeon.find().⇒ Route A: a real production surface exists to pin, and it was genuinely uncovered, so the block is re-pointed rather than deleted.
What changed
The block now constructs an
ObjectStackAdapterwith a mockedfetch(same pattern asorderby-serialization.test.ts/queryDataset.test.tsin this package) and drives the realfind()tonormalizeQueryResult()path:records/total/hasMoreenvelope into the returnedQueryResult(data/total/hasMore/pageSize/page)pagefrom$skip/$tophasMoreestimate (records.length === $top) when the server omits ithasMore: falsefor a short (non-full) page with no server hintPositive control (route A requires one)
Before pushing, I temporarily hardcoded
hasMore = falseandpage = 1innormalizeQueryResult()as an uncommitted local edit (reverted afterward withgit checkoutagainst the already-committed branch, pointed atpackages/data-objectstack/src/index.ts— the fix commit went in first per this repo's reverse-verification discipline), and re-ran the suite:3 of 4 new assertions went red (the 4th — "reports hasMore false for a short page" — stayed green because the mutation coincidentally also produced
hasMore: false, which is expected and not a gap: that test is there to guard againsthasMoredefaulting totrue, the opposite direction). Reverting restored all 4 green, confirming the block now actually exercises and can detect drift in production code, unlike the block it replaces.Tests
At final commit
820b4d716:Changeset
Test-only change — added
.changeset/paginated-result-vacuous-block-4712.mdwith empty frontmatter (declares "releases nothing", the repo's explicit first-class pass for internal-only changes).Generated by Claude Code