Skip to content

Commit 02086eb

Browse files
committed
Add the changeset for the docs sample change
`@objectstack/docs` patch, following #13955 (the most recent `content/docs/**` diff, which named that package). `@objectstack/example-showcase` is deliberately not named: it is private and appears in 0 of the repo's changesets, and #13705 — the immediately preceding repair at two of these same three sites — carried no changeset at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC
1 parent ddc14ec commit 02086eb

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
"@objectstack/docs": patch
3+
---
4+
5+
docs(react-pages): delete the unreachable `Array.isArray(result)` limb from the live-data sample
6+
7+
`ObjectStackAdapter.find()` cannot resolve to an array, so the `Array.isArray(result)`
8+
arm the live-data sample carried could never be taken. Re-derived against objectui at
9+
the sha this repo pins (`9602dc82`) and again at objectui `origin/main`, which agree
10+
line for line:
11+
12+
- `find()` returns from five points — `{ data: [], total: 0 }` for a resource already
13+
memoized as missing, `{ data: [], total: 0 }` for a fresh 404 that is not an
14+
`enable`-block denial, two `normalizeQueryResult(...)` calls (the `$expand`/`$search`
15+
raw-GET path and the client-SDK path), and `return existing`, which hands back a
16+
promise produced by that same set.
17+
- Both branches of `normalizeQueryResult()` return an object literal with exactly
18+
`data`, `total`, `page`, `pageSize`, `hasMore`. The first branch is the one that
19+
makes the limb dead: it tests `Array.isArray(result)` on the *transport* response and
20+
**wraps** a bare array into that envelope. The array case is folded before any caller
21+
sees it.
22+
23+
The sample now reads `result.data` directly, and a new paragraph under it states the
24+
envelope contract so the reason survives the next edit. The two `kind:'react'` pages in
25+
`examples/app-showcase` carrying the same dead limb — `crm-workbench` and
26+
`renewals-pipeline` — were repaired in the same edit, with the derivation recorded in the
27+
comment that already explains the neighbouring `.records` trap.
28+
29+
Behaviour-preserving: `.data` was read first and always won. What goes is a shape the
30+
producer cannot emit, sitting in the page a customer — and a coding agent — copies from.

0 commit comments

Comments
 (0)