You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rest): strip read decorations before validating a dataset query (#4879)
Every widget on every dataset-bound dashboard failed with
"Dataset query failed: 400 Bad Request — Invalid dataset definition."
POST /analytics/dataset/query resolves a saved `datasetName` through
`getMetaItems`, and the metadata READ path stamps its spec-validation
verdict `_diagnostics` onto every document it serves. Since #4001 closed
the metadata schemas, `DatasetSchema.parse()` rejects unrecognized keys
rather than dropping them — so the route handed a served document back to
the schema that produced it and got `unrecognized_keys: ["_diagnostics"]`.
The 400 blamed the author for a key the server had just added.
This is exactly what `stripReadDecorations` exists to prevent, and the
failure `spec/kernel/metadata-read-decorations.ts` already documents from
the cold-boot flow bind (cloud#971). Strip before validating.
Applied on BOTH branches, not only the `datasetName` read: the Studio
dataset preview posts its draft inline, and that draft is the document the
designer GET-loaded, decorations included. A hand-authored draft never
carries these keys, so the strip is a no-op there. The ADR-0010 provenance
envelope (`_packageId`, `_provenance`, …) is not a read decoration and
still survives.
Regression coverage for the saved-dataset path was the gap that let this
ship — every existing case passed the dataset inline, so nothing exercised
the read. Tests now cover resolve-by-name, the inline decorated draft, the
404, and a genuinely malformed saved dataset (still 400).
Also bumps the vendored console pin to objectui@f5bc4c78be76 via
scripts/bump-objectui.sh, with the changeset it generates.
Verified in a real browser against the showcase app: before, all 8 widgets
of showcase_ops_dashboard rendered the 400; after, all 8 render live data,
with zero failed responses and zero console errors.
Claude-Session: https://claude.ai/code/session_01QuQBvLsJWuYFAYdkqDbM4N
Co-authored-by: Claude <noreply@anthropic.com>
Console (objectui) refreshed to `f5bc4c78be76`. Frontend changes in this range:
6
+
7
+
Derived from the changesets objectui declared over the range — 11 releasing of 11 changesets added across 31 non-merge commits; omitted: 20 commits carrying no changeset (they ship no package code).
8
+
9
+
-**minor** — Field widgets are finally told when their field fails validation, and the props slot that carries it takes the name the published contract gives it (objectui#3222). (objectui `56409c28c`)
10
+
-**minor** — Retire `validation` from the action-param contract — it was declared on both halves, read by neither, and rejected outright by the server (objectui#3201). (objectui `f833d3ae4`)
11
+
-**patch** — Five metadata designers stop rendering keys `@objectstack/spec` rejects, and start rendering the keys it declares (objectui#3275, objectui#3281). (objectui `8ff3ad7b8`)
12
+
-**patch** — The Page block inspector's conditional-visibility control now authors `visibleWhen`, and says "Visible when" while doing it (objectui#3229). (objectui `8e02ad7f2`)
13
+
-**patch** — The record discussion panel no longer shows the PREVIOUS record's comments and activity (objectui#3268). (objectui `a8aa57663`)
14
+
-**patch** — The form renderer's built-in `select` branch stops saying "No options available" in English to non-English sessions (objectui#3263). (objectui `a7651e640`)
15
+
-**patch** — The record discussion panel now says "loading" while it is loading, instead of "No comments yet" (objectui#3209). (objectui `12bf6691e`)
16
+
-**patch** — The legacy `page-header` alias stops advertising `description` as an authorable key (objectui#3226). (objectui `d2363e710`)
17
+
-**patch** — The option widgets' "this list cannot be filled" message now has one source, and it is translated (objectui#3231). (objectui `825bbe33c`)
it('maps a dataset D-C compile error to 400 (undeclared relationship)',async()=>{
94
152
constqueryDataset=vi.fn().mockRejectedValue(newError("dimension \"region\" references relationship \"account\" via \"account.region\", but \"account\" is not declared in the dataset's `include`."));
0 commit comments