Uh oh!
There was an error while loading. Please reload this page.
fix(client-react): data-hooks.tsx TSDoc examples read data?.value, not data?.records - #10970
Conversation
…t data?.records useQuery and usePagination's @example blocks read data?.value, a key PaginatedResult never declares (packages/client/src/index.ts:310 declares exactly records, total, object, hasMore). Unlike the sibling defect in content/docs/ui/react-pages.mdx (which read?.records failed silently), this one throws: data resolves to a real object, data.value is undefined, and .map on undefined is a TypeError that takes the copied component down. Both sites now read data?.records, matching content/docs/api/client-sdk.mdx. Swept all four @example blocks in the file per the card's rider: useMutation and useInfiniteQuery never referenced .value and needed no change. Fixes#10750
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Uh oh!
There was an error while loading. Please reload this page.
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 32546214252 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Fixes#10750
The defect
packages/client-react/src/data-hooks.tsxcarried two TSDoc@exampleblocks(the
useQueryexample at what was line 82, and theusePaginationexampleat what was line 405) that read
data?.value.PaginatedResultneverdeclared a
valuekey, so the read was alwaysundefined, and once thequery resolved,
.maponundefinedthrew — a reader copying either examplecrashed on first successful load.
Where I read the declared type
PaginatedResult<T>is declared atpackages/client/src/index.ts:310-319onmain(verified in this worktree, not taken from the card):Exactly four members —
records,total,object,hasMore— confirmingdata?.records(read from the type, not assumed from the card) is thecorrect replacement.
The sweep (card's rider)
Searched the file for every
@exampleblock rather than trusting the twocited line numbers:
@exampleblocks examined (lines 68, 243, 386, 497 —useQuery,useMutation,usePagination,useInfiniteQuery).useQueryexample (line 82) and theusePaginationexample (line 405).useMutationanduseInfiniteQueryexamples never referenced.valueat all (
useMutation's example logs the mutation result directly;useInfiniteQuery's example correctly reads the pre-flattenedflatData)and needed no change.
grep -n '\.value\b'andgrep -rn 'data?.value'overpackages/client-react/src/both return nothing.Verification
origin/mainbefore editing — both sitesstill read
data?.valueat filing time; the defect was live, not stale.pnpm --workspace-concurrency=2 --filter '@objectstack/client-react^...' build— 32-package closure,
VERDICT command-exit 0.pnpm --filter @objectstack/client-react typecheck(
tsc --noEmit) —VERDICT command-exit 0.pnpm --filter @objectstack/client-react test -- --maxWorkers=2—
Test Files 3 passed (3)/Tests 34 passed (34).change with no runtime behavior to revert-and-diff. Ran the package's real
typecheck and test suite instead (above) as the closest applicable check.
e8b3bb31f0vianode scripts/pm/dispatch-gates.mjs(merge-base926778bcevsorigin/main), all run throughscripts/pm/os-verify-lock.sh, each itsown verdict line:
pnpm check:changeset-gate-self-tests→--- changeset-gate-self-tests EXIT=0(three self-tests, each printing its own✓ ... --self-testline)pnpm check:objectui-changeset→✓ objectui-changeset-digest --self-test: all checks passed/✓ objectui-range --self-test: all checks passedpnpm check:slot-lookup→✓ slot-lookup ratchet holds: 107 unswept site(s) in 25 file(s), none newpnpm check:test-source-alias→check-test-source-alias OK — 72 packages with tests scannedpnpm check:type-source-resolution→check-type-source-resolution OK — 76 packages with a tsconfig.json scannednode scripts/check-adr-0087-registration.mjs→✓ check-adr-0087-registration: this PR adds no declared-breaking changesetnode scripts/check-changeset-no-major.mjs→✓ This diff introduces no 'major' bump.node scripts/check-ci-filter-parity.mjs→OK: all 82 declared cross-package glob(s) ... are coverednode scripts/check-empty-changeset.mjs→✓ No empty-frontmatter changeset introduced by this diff (1 declaring changeset(s) added).node scripts/check-plugin-teardown-shape.mjs→✓ check:plugin-teardown-shape: 57 Plugin implementation(s) ... every teardown-shaped method ... sits beside a real destroy()node scripts/docs-audit/check-affected-docs.mjs→✓ affected-docs self-test: 339 cases pass.(then its normal informational route-ledger report)VERDICT command-exit 0Changeset
.changeset/data-hooks-tsdoc-records-key.md—@objectstack/client-reactpatch.
Out of scope
The card's "nothing type-checks these blocks" observation is a separate
devx-lane gate idea, not built here — filed as #10969 (
finding+domain:cli), labels confirmed landed.Generated by Claude Code