Skip to content

Commit 9e2c7a5

Browse files
committed
test(objectql): the adoption pins type the data-plane read options instead of erasing them (#23646)
Claude-Session: https://claude.ai/code/session_01GP3comALHRcRBixS2TEnLF Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3061f6f commit 9e2c7a5

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎packages/objectql/src/protocol-adopt-orphans-object-registry.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
import { randomUUID } from 'node:crypto';
5555
import { afterEach, describe, expect, it, vi } from 'vitest';
5656
import { ObjectKernel } from '@objectstack/core';
57-
import { ObjectQL } from './engine.js';
57+
import { ObjectQL, type EngineReadOptions } from './engine.js';
5858
import { ObjectQLPlugin } from './plugin.js';
5959

6060
type Stores = Map<string, Map<string, Record<string, unknown>>>;
@@ -137,6 +137,9 @@ function makeMemoryDriver(stores: Stores, drops: string[]) {
137137
return driver;
138138
}
139139

140+
/** The data plane read, as the system reads it: typed, never erased (`check:query-options-erasure`). */
141+
const SYSTEM_READ: EngineReadOptions = { context: { isSystem: true } };
142+
140143
const Q = 'com.qa.q';
141144
const R = 'com.qa.r';
142145
const NAME = 'qa_probe_gadget';
@@ -202,7 +205,7 @@ describe('#23646 — an orphan adoption moves an adopted object\'s registry owne
202205
*/
203206
async function served(k: Booted) {
204207
const read = await k.protocol.getMetaItem({ type: 'object', name: NAME });
205-
const records = await k.engine.find(NAME, {}, { context: { isSystem: true } } as any);
208+
const records = await k.engine.find(NAME, {}, SYSTEM_READ);
206209
const object = k.engine.registry.getObject(NAME) as { label?: string; _packageId?: string } | undefined;
207210
return {
208211
owner: k.engine.registry.getObjectOwner(NAME)?.packageId,

0 commit comments

Comments
 (0)