Skip to content

Commit 8a33dff

Browse files
fix(service-analytics)!: the dataset draft preview mints and judges an undeclared measure as the live strategies do, so a misspelled measure is refused INVALID_FIELD instead of answered as a row count (#28210)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DLMAJ9kZMBicdMLygftCdLd)_ domain:server#3 · os-elon-musk · session_016WV4cyQNVxpxREGfKkTsqs Fixes #28172 Clause-②: no (narrowing) — a draft-preview dataset query (`queryDataset` with `previewDrafts: true` over a pending seed draft) now refuses a selected measure that the native and ObjectQL strategies refuse, which it served as a row count before. No export, answer member, status or error code is added: the refusals are the live faces' existing `INVALID_FIELD` / 400 and `PERMISSION_DENIED` / 403. Metadata-protocol: none ## 维护者速读 - 改了什么:数据集草稿预览遇到数据集未声明的度量,过去一律按 `count(*)` 给行数;现在按实时查询同一套铸造规则(`<字段>_sum` 等后缀、裸字段名即求和)生成度量,并在读种子行前过实时查询的同一组度量闸门。拼错的 `nope`、`ghost_avg` 现在与实时一样按 400 `INVALID_FIELD` 拒,消息逐字相同;`amount_sum`、`amount` 现在给出与实时相同的 SUM 值,不再是行数。 - 为什么改:草稿里的错别字显示一个看似合理的数,发布后才被拒;能用的推断度量在草稿里也显示错的数。 - 风险与回滚:只影响草稿预览路径上未声明的度量;已声明度量、时长度量、派生度量和 `count` 不变,实时策略不变。回滚即 revert。 - 先看:`packages/services/service-analytics/src/analytics-service.ts` 里 `answerDataset` 的 `previewService.query`(新增的铸造与闸门),同文件 `mintCallerMeasures`(从 `ensureCube` 抽出的共用循环);`preview-evaluator.ts` 的度量聚合步。 - 两分钟验证:`pnpm --filter @objectstack/service-analytics exec vitest run src/__tests__/preview-undeclared-measure-parity.test.ts`,预期 10 passed。 - 需要你做的:无,席位落地。 ## What changes **The draft preview's measure step (`analytics-service.ts`, `answerDataset` → `previewService.query`).** Before evaluating seed rows, the preview now does for a measure the dataset does not declare what the published path's `ensureCube` does: - mints it with `mintCallerMeasures`, the loop `ensureCube` ran inline, now extracted and shared by both: the `<cube>.` qualifier rule (`mintableMeasureKey`, a dotted non-qualifier measure refused), then `inferMeasure`'s suffix convention (`_sum` / `_avg` / `_min` / `_max` / `_count_distinct`, a bare name meaning its sum, a spelling that names no field refused). Declared measures, declared dotted keys and dataset duration measures are never minted, as before; - asks `assertMeasureFields` (#4437): a source field the object does not have is refused `INVALID_FIELD` / 400 with the same message, `Valid measures:` listing the declared ones; - asks the measure position of the #21156 column-reference gate, extracted from `assertCallerMembersResolvable` as `assertCallerMeasuresResolvable` (no behaviour change on the live path): a spelling that is not a column reference (`amount + 1`) is refused `PERMISSION_DENIED` / 403; - asks the #21044 aggregate × field-type door (`assertMeasureFieldTypes`), which the live path asks in `ensureCube`: `region_sum` over a text field is refused `INVALID_FIELD` / 400, where the preview would otherwise sum no number and read `0`; - hands the cube WITH the minted measures to the preview's existing gates (stored-body, internal-field, field-level read, record-currency) and to the evaluator, as the live gates read the cube after `ensureCube`. So a minted measure is judged by the field it aggregates: `secret_sum` is refused 403 when the caller may not read `secret`. Without this, minting on the preview would sum a field the field gate never saw (`namedQueryFields` skips a measure the cube does not carry). **The evaluator (`preview-evaluator.ts`, `evaluateAnalyticsQueryOverRows`).** A measure the cube it is handed does not carry is refused `INVALID_FIELD` / 400 (`invalidMemberError`, member and valid measures named) instead of being read as `count(*)`. The production caller never reaches it now (it hands over the minted cube); it stops the silent fallback from coming back. **Answers that change value.** On the preview, an inferred measure over a real field (`amount_sum`, `amount`, …) now answers the live value instead of a row count. The changeset says so. **Unchanged.** Declared, duration and derived measures, the undeclared `count`, and both live strategies. **Not in this PR.** An undeclared DIMENSION has the same gap on the preview (`dimensions: ['bogus']` is refused `INVALID_FIELD` live and served as one `null` group on the preview). Measured here, reported to the seat and carded as #28201. ## Why Measured on `main` `35f20551`, real SQLite engine, a dataset declaring `total` (sum of `amount`) and `deals` (count), `dimensions: ['region']`: | measure | native | ObjectQL | draft preview (before) | draft preview (after) | |:---|:---|:---|:---|:---| | `nope` | `INVALID_FIELD` / 400 | `INVALID_FIELD` / 400 | `{amer: 2, emea: 1}` | `INVALID_FIELD` / 400, same message | | `ghost_avg` | `INVALID_FIELD` / 400 | `INVALID_FIELD` / 400 | `{amer: 2, emea: 1}` | `INVALID_FIELD` / 400, same message | | `amount_sum` | `{amer: 150, emea: 30}` | `{amer: 150, emea: 30}` | `{amer: 2, emea: 1}` | `{amer: 150, emea: 30}` | | `amount` | `{amer: 150, emea: 30}` | `{amer: 150, emea: 30}` | `{amer: 2, emea: 1}` | `{amer: 150, emea: 30}` | | `region_sum` (text) | `INVALID_FIELD` / 400 | `INVALID_FIELD` / 400 | `{amer: 2, emea: 1}` | `INVALID_FIELD` / 400, same message | | `amount + 1` | `PERMISSION_DENIED` / 403 | `PERMISSION_DENIED` / 403 | `{amer: 2, emea: 1}` | `PERMISSION_DENIED` / 403, same message | | `total` (declared), `count` | served | served | served, same values | served, same values | The live faces do not refuse every undeclared measure: they infer one over a real field. So the triage rule ("refuses a measure the dataset does not declare with the live faces' envelope … pin native, ObjectQL and draft-preview parity") is implemented as parity: the preview refuses exactly what the live faces refuse, with their envelope, and serves what they serve. The seat confirmed this reading before the fix. ## Verification - `packages/services/service-analytics/src/__tests__/preview-undeclared-measure-parity.test.ts` (new, 10, real SQLite engine through `queryDataset`, each case on all three faces): `nope` and `ghost_avg` refused `INVALID_FIELD` / 400 with `param`, `field`, `measure` and a message identical across native, ObjectQL and preview; `amount_sum` and `amount` served `{amer: 150, emea: 30}`; `region_sum` refused `INVALID_FIELD` / 400 and `amount + 1` refused `PERMISSION_DENIED` / 403, preview message identical to native; CONTROLS: declared `total` and undeclared `count` serve the same values on every face; the evaluator refuses an uncarried measure (and serves a carried one); a minted `secret_sum` is refused `PERMISSION_DENIED` / 403 naming `secret` on the preview and on a live strategy when the caller may not read `secret`. - Ablations (each on the source, pins rerun): both source files reset to `main` ⇒ 8 red, the 2 CONTROLs green (one of the 8, the field-read case, was added after this run and is covered by ablation A); A: the preview's field-read gate given the cube without the minted measures ⇒ the `secret_sum` case red; B: no field-type door on the preview ⇒ the `region_sum` case red; C: no caller-measure gate on the preview ⇒ the `amount + 1` case red; D: no `assertMeasureFields` on the preview ⇒ the `nope` and `ghost_avg` cases red. Every added gate's pin bites on its own. - `pnpm --filter @objectstack/service-analytics exec vitest run` at head (merged with `main` `1e45a4e1`): 198 files, 4788 passed, 282 skipped, 0 failed. `pnpm --filter @objectstack/service-analytics typecheck` and eslint on the touched files clean. - `check-issue-citations` and `check:doc-authoring` green at head. Every `dispatch-gates --commands` family (62), `pnpm lint` and the dogfood battery run at the final head: the readings are posted on the card with the os-dev report. Skills-docs: none. `git grep -n -i -E "previewDrafts|draft (data )?preview" -- skills content/docs` (references excluded) finds `content/docs/data-modeling/currency.mdx:146` (the currency door covers the preview: still true) and release notes; nothing in `skills/` or `content/docs/` describes how the preview answers an undeclared measure. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (Not touched.) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the 维护者速读 block is the lane's maintainer summary). --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cyQNVxpxREGfKkTsqs)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cyQNVxpxREGfKkTsqs Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1ea3fe9 commit 8a33dff

4 files changed

Lines changed: 382 additions & 20 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@objectstack/service-analytics': patch
3+
---
4+
5+
fix(service-analytics)!: the dataset draft preview mints and judges a measure the dataset does not declare as the live strategies do, so a misspelled measure is refused `INVALID_FIELD` instead of answered as a row count
6+
7+
Clause-②: no (narrowing) — a draft-preview dataset query (`queryDataset` with `previewDrafts: true` over a pending seed draft) now refuses a selected measure that the native and ObjectQL strategies refuse, which it served before. Nothing is widened: no export, answer member, error code or status is added.
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export or type changes: the draft preview now answers an undeclared measure the way the published dataset already answers it. The refusals are the live faces' existing ones, so there is nothing for a migration to rewrite and no tombstone. -->
11+
12+
**BREAKING** accept-set narrowing on the draft preview of `queryDataset` (`@objectstack/service-analytics`).
13+
14+
- **Before.** The preview read every measure the dataset does not declare as `count(*)`. A misspelled `nope` or `ghost_avg` answered a row count per group under the typo, where both live strategies refuse it `INVALID_FIELD` / 400 ("Measure 'nope' on cube … aggregates field 'nope', which object … does not have. Valid measures: …"). A working spelling read the wrong number too: `amount_sum`, or a bare `amount`, answered the row count where the live strategies answer `SUM(amount)`.
15+
- **Now.** The preview mints an undeclared measure with the live strategies' own mint (the `<cube>.` qualifier rule, then the `_sum` / `_avg` / `_min` / `_max` / `_count_distinct` suffix convention, a bare field name meaning its sum) and asks the same gates before it reads a seed row: a field the object does not have is refused `INVALID_FIELD` / 400 with the same message; an aggregate the field-type table refuses (`region_sum` over a text field) is refused `INVALID_FIELD` / 400; a spelling that is not a column reference (`amount + 1`) is refused `PERMISSION_DENIED` / 403; and the field-level read gate judges a minted measure by the field it aggregates.
16+
- **Answers that change value.** On the preview, the answer for an inferred measure over a real field (`amount_sum`, `amount`, `amount_avg`, …) changes from a row count to the live value, the number the published dataset serves.
17+
- **Unchanged.** A declared measure, a duration measure, a derived measure and the undeclared `count` serve what they served. The live strategies are unchanged.
18+
- **Who sees it.** A Studio author whose draft widget names a measure the dataset does not declare: a typo now shows the refusal it meets once published, instead of a plausible count.
19+
20+
**The remedy.** Name a measure the dataset declares, or spell an inferred one over a field the object has (`<field>_sum`, `<field>_avg`, …).
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* [#28172] A measure the dataset does not declare, through `queryDataset` on
5+
* the native strategy, the ObjectQL strategy and the draft preview.
6+
*
7+
* ## What these pins hold
8+
*
9+
* The live faces mint an undeclared measure (`mintableMeasureKey` +
10+
* `inferMeasure`: `amount_sum` is `SUM(amount)`, a bare `amount` is
11+
* `SUM(amount)`) and judge it before a strategy reads anything. The draft
12+
* preview now mints and judges it the same way:
13+
*
14+
* - A spelling whose field the object does not have (`nope`, `ghost_avg`) is
15+
* refused `INVALID_FIELD` / 400 on every face, with the same message naming
16+
* the member and the valid measures. Before, the preview served a row count
17+
* per group under the misspelled name.
18+
* - A spelling over a real field (`amount_sum`, `amount`) serves the live value
19+
* on every face. Before, the preview served the row count.
20+
* - A minted aggregate the field-type table refuses (`region_sum` over text)
21+
* and a spelling that is not a column reference (`amount + 1`) get the live
22+
* faces' refusals on the preview too, rather than `0` or a sum of nothing.
23+
* - CONTROL: a declared measure and the undeclared `count` serve the same
24+
* values on every face.
25+
* - The evaluator refuses a measure the cube it is handed does not carry,
26+
* instead of reading it as `count(*)`.
27+
* - A minted measure is judged by the field it aggregates: the field-level read
28+
* gate refuses `secret_sum` on the preview, as on a live strategy, when the
29+
* caller may not read `secret`. Without that, minting on the preview would
30+
* sum a field the caller may not read.
31+
*/
32+
33+
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
34+
import { ObjectQL } from '@objectstack/objectql';
35+
import { SqlDriver } from '@objectstack/driver-sql';
36+
import { DatasetSchema } from '@objectstack/spec/ui';
37+
import type { AnalyticsResult } from '@objectstack/spec/contracts';
38+
import type { Cube } from '@objectstack/spec/data';
39+
import type { ExecutionContext } from '@objectstack/spec/kernel';
40+
import { AnalyticsService } from '../analytics-service.js';
41+
import { evaluateAnalyticsQueryOverRows } from '../preview-evaluator.js';
42+
import { AnalyticsServicePlugin } from '../plugin.js';
43+
import { installDefaultOrganization } from './default-organization.testkit.js';
44+
45+
const OBJECT = 'os28172_deal';
46+
47+
const ROWS = [
48+
{ id: 'd1', region: 'amer', amount: 100 },
49+
{ id: 'd2', region: 'amer', amount: 50 },
50+
{ id: 'd3', region: 'emea', amount: 30 },
51+
] as const;
52+
53+
const DATASET = DatasetSchema.parse({
54+
name: 'os28172_deals',
55+
label: 'Deals',
56+
object: OBJECT,
57+
dimensions: [{ name: 'region', field: 'region', type: 'string' }],
58+
measures: [
59+
{ name: 'total', aggregate: 'sum', field: 'amount' },
60+
{ name: 'deals', aggregate: 'count' },
61+
],
62+
});
63+
64+
type Face = 'native' | 'objectql' | 'preview';
65+
const FACES: readonly Face[] = ['native', 'objectql', 'preview'];
66+
67+
const quiet = { debug() {}, info() {}, warn() {}, error() {}, trace() {}, fatal() {}, child() { return quiet; } };
68+
69+
type Refusal = Error & { code?: string; status?: number; param?: string; field?: string; measure?: string; member?: string };
70+
71+
const refusalOf = (p: Promise<unknown>): Promise<Refusal> =>
72+
p.then<never, Refusal>(
73+
() => {
74+
throw new Error('expected a refusal, but the query resolved');
75+
},
76+
(e) => e as Refusal,
77+
);
78+
79+
const byRegion = (result: AnalyticsResult, measure: string) =>
80+
Object.fromEntries((result.rows as Array<Record<string, unknown>>).map((r) => [r.region, r[measure]]));
81+
82+
/** A `'protocol'` service answering one pending seed draft, which routes `previewDrafts` onto the preview path. */
83+
const pendingSeedProtocol = {
84+
getMetaItems: async () => [{ name: 'os28172_seed', object: OBJECT }],
85+
getMetaItem: async () => ({ item: { records: ROWS } }),
86+
};
87+
88+
describe('[#28172] an undeclared measure on the native, ObjectQL and draft-preview faces', () => {
89+
let engine: ObjectQL;
90+
const services: Partial<Record<'native' | 'objectql', AnalyticsService>> = {};
91+
92+
const ask = (face: Face, measure: string) =>
93+
services[face === 'preview' ? 'objectql' : face]!.queryDataset(
94+
DATASET,
95+
{ dimensions: ['region'], measures: [measure] } as never,
96+
undefined,
97+
face === 'preview' ? { previewDrafts: true } : undefined,
98+
);
99+
100+
beforeAll(async () => {
101+
const driver = new SqlDriver({ client: 'better-sqlite3', connection: { filename: ':memory:' }, useNullAsDefault: true } as never);
102+
engine = new ObjectQL({ logger: quiet } as never);
103+
engine.registerDriver(driver as never, true);
104+
await engine.init();
105+
engine.registry.registerObject({
106+
name: OBJECT,
107+
label: 'Deal',
108+
fields: {
109+
region: { name: 'region', type: 'text' },
110+
amount: { name: 'amount', type: 'number' },
111+
},
112+
} as never);
113+
await engine.syncSchemas();
114+
await installDefaultOrganization(engine as never);
115+
for (const row of ROWS) await engine.insert(OBJECT, { ...row } as never);
116+
117+
for (const [face, caps] of [
118+
['native', undefined],
119+
['objectql', () => ({ nativeSql: false, objectqlAggregate: true, inMemory: false })],
120+
] as const) {
121+
const registered: Record<string, unknown> = {};
122+
const provided: Record<string, unknown> = { data: engine, protocol: pendingSeedProtocol };
123+
await new AnalyticsServicePlugin({ ...(caps ? { queryCapabilities: caps } : {}) } as never).init({
124+
getService: (name: string) => provided[name] ?? registered[name],
125+
registerService: (name: string, svc: unknown) => { registered[name] = svc; },
126+
replaceService: (name: string, svc: unknown) => { registered[name] = svc; },
127+
hook: () => {},
128+
logger: quiet,
129+
} as never);
130+
services[face] = registered.analytics as AnalyticsService;
131+
}
132+
});
133+
134+
afterAll(async () => {
135+
try { await engine?.destroy(); } catch { /* noop */ }
136+
});
137+
138+
for (const [measure, field] of [['nope', 'nope'], ['ghost_avg', 'ghost']] as const) {
139+
it(`refuses '${measure}' INVALID_FIELD / 400 with one message on every face`, async () => {
140+
const refusals = await Promise.all(FACES.map((face) => refusalOf(ask(face, measure))));
141+
for (const err of refusals) {
142+
expect(err.code, err.message).toBe('INVALID_FIELD');
143+
expect(err.status).toBe(400);
144+
expect(err.param).toBe('measures');
145+
expect(err.field).toBe(field);
146+
expect(err.measure).toBe(measure);
147+
expect(err.message).toContain(`Measure '${measure}' on cube 'os28172_deals' aggregates field '${field}'`);
148+
expect(err.message).toContain('Valid measures: total, deals.');
149+
}
150+
const [native, objectql, preview] = refusals;
151+
expect(preview.message).toBe(native.message);
152+
expect(objectql.message).toBe(native.message);
153+
});
154+
}
155+
156+
for (const measure of ['amount_sum', 'amount'] as const) {
157+
it(`serves '${measure}' as SUM(amount) on every face`, async () => {
158+
for (const face of FACES) {
159+
const result = await ask(face, measure);
160+
expect(byRegion(result, measure), face).toEqual({ amer: 150, emea: 30 });
161+
}
162+
});
163+
}
164+
165+
it("refuses 'region_sum' over a text field INVALID_FIELD / 400 with one message on every face", async () => {
166+
const refusals = await Promise.all(FACES.map((face) => refusalOf(ask(face, 'region_sum'))));
167+
for (const err of refusals) {
168+
expect(err.code, err.message).toBe('INVALID_FIELD');
169+
expect(err.status).toBe(400);
170+
}
171+
expect(refusals[2].message).toBe(refusals[0].message);
172+
});
173+
174+
it("refuses 'amount + 1', which is not a column reference, PERMISSION_DENIED / 403 on every face", async () => {
175+
const refusals = await Promise.all(FACES.map((face) => refusalOf(ask(face, 'amount + 1'))));
176+
for (const err of refusals) {
177+
expect(err.code, err.message).toBe('PERMISSION_DENIED');
178+
expect(err.status).toBe(403);
179+
}
180+
expect(refusals[2].message).toBe(refusals[0].message);
181+
});
182+
183+
for (const [measure, expected] of [['total', { amer: 150, emea: 30 }], ['count', { amer: 2, emea: 1 }]] as const) {
184+
it(`CONTROL: '${measure}' serves the same values on every face`, async () => {
185+
for (const face of FACES) {
186+
const result = await ask(face, measure);
187+
expect(byRegion(result, measure), face).toEqual(expected);
188+
}
189+
});
190+
}
191+
192+
it('the evaluator refuses a measure the cube it is handed does not carry, instead of counting rows', () => {
193+
const cube = {
194+
name: 'c',
195+
title: 'c',
196+
sql: OBJECT,
197+
measures: { total: { label: 'Total', type: 'sum', sql: 'amount' } },
198+
dimensions: { region: { label: 'Region', type: 'string', sql: 'region' } },
199+
} as unknown as Cube;
200+
const rows = ROWS.map((r) => ({ ...r }));
201+
let err: Refusal | undefined;
202+
try {
203+
evaluateAnalyticsQueryOverRows({ cube: 'c', measures: ['nope'], dimensions: ['region'] }, cube, rows);
204+
} catch (e) {
205+
err = e as Refusal;
206+
}
207+
expect(err?.code).toBe('INVALID_FIELD');
208+
expect(err?.status).toBe(400);
209+
expect(err?.member).toBe('nope');
210+
expect(err?.message).toContain('Valid measures: total.');
211+
const served = evaluateAnalyticsQueryOverRows({ cube: 'c', measures: ['total'], dimensions: ['region'] }, cube, rows);
212+
expect(byRegion(served, 'total')).toEqual({ amer: 150, emea: 30 });
213+
});
214+
});
215+
216+
describe('[#28172] a minted measure on the draft preview meets the field-level read gate', () => {
217+
const CALLER = { userId: 'u_member', tenantId: 'org_a' } as ExecutionContext;
218+
const DEAL = 'os28172_secret_deal';
219+
const dataset = DatasetSchema.parse({
220+
name: 'os28172_secret',
221+
label: 'Secret',
222+
object: DEAL,
223+
dimensions: [{ name: 'region', field: 'region', type: 'string' }],
224+
measures: [{ name: 'deals', aggregate: 'count' }],
225+
});
226+
const service = (draft: boolean) =>
227+
new AnalyticsService({
228+
queryCapabilities: () => ({ nativeSql: true, objectqlAggregate: false, inMemory: false }),
229+
getObjectFieldNames: () => ['region', 'secret'],
230+
getReadableFields: () => ['id', 'region'],
231+
...(draft ? { draftRowsResolver: async () => [{ id: 'd1', region: 'amer', secret: 7 }] } : {}),
232+
executeRawSql: async () => [],
233+
executeAggregate: async () => [],
234+
} as never);
235+
236+
it("refuses 'secret_sum' PERMISSION_DENIED / 403 naming 'secret' on the preview and on the live strategy", async () => {
237+
for (const draft of [false, true]) {
238+
const err = await refusalOf(
239+
service(draft).queryDataset(
240+
dataset,
241+
{ dimensions: ['region'], measures: ['secret_sum'] } as never,
242+
CALLER,
243+
draft ? { previewDrafts: true } : undefined,
244+
),
245+
);
246+
expect(err.code, err.message).toBe('PERMISSION_DENIED');
247+
expect(err.status).toBe(403);
248+
expect((err as Refusal & { fields?: string[] }).fields).toEqual(['secret']);
249+
}
250+
});
251+
});

0 commit comments

Comments
 (0)