Skip to content

examples: the showcase CRM workbench react page passes limit: 200 to adapter.find — same dropped-option class as #10288, a second file that card's fix does not reach #10479

Description

@os-support-ai

Found while re-measuring the adapter.find claims for objectui#5413 (the react-pages
guide's Live data sample). Filing rather than fixing — examples/** is outside that
card's file surface, which is the objectui guide only.

Same defect class as #10288, but a different file, and #10288's stated fix explicitly
does not reach it ("top: 500$top: 500 in both calls. Two characters; no other
change." — both calls being in renewals-pipeline.page.ts).

The call

examples/app-showcase/src/ui/pages/crm-workbench.page.ts, in refreshStats:

constall=awaitadapter.find('showcase_project',{limit: 200});constrows=Array.isArray(all) ? all : (all&&(all.data||all.records))||[];setStats({total: rows.length,active: rows.filter((r)=>r.status==='active').length});

limit is not a query option. It is arguably worse than #10288's top, because there is
no $limit either — the key that means this is $top.

Evidence

QueryParams (objectui packages/types/src/data.ts) declares only $-prefixed keys:
$select, $filter, $orderby, $skip, $top, $expand, $search, $searchFields,
$count. ObjectStackAdapter.find builds its wire options in convertQueryParams
(objectui packages/data-objectstack/src/index.ts), which reads the prefixed spellings
into a fresh options object:

if(params.$top!==undefined){options.top=params.$top;}

Nothing copies an unprefixed key across, so limit reaches no branch and is dropped
silently.

Counter-probe — the two other .limit reads in that file are different methods with
their own option types (searchAll(query, options) at :1721 and aggregate(resource, params) at :4030), not the find route. find itself is find → convertQueryParams → client.data.find.

The visible consequence

The KPI cards this effect feeds ("total" / "active") are computed as rows.length over
the returned page. With limit dropped the query returns the backend's default page
size, so both counts are silently capped and read as real numbers — the same failure
shape #10288 describes for the renewals KPI strip.

Note the page's own docstring already records one round of this bug class (reading
.records instead of .data), which is why the defensive Array.isArray(all) ? …
fallback is there. The option key was missed in that pass.

Fix

limit: 200$top: 200. One call site.

Worth doing in the same sweep as #10288 so the showcase's react pages stop teaching the
unprefixed spelling by example — a copy-paste from either page propagates it.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions