Skip to content

Commit 7bae61b

Browse files
committed
test(objectql): the blank-door stub's find answers the store, not a query
check:objectql-double-limit could not seat the id-only filter as a query-honouring double; nothing in the file reads rows back through find. Claude-Session: https://claude.ai/code/session_01Bvd69VPa6puiNzzPUroDBx Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4525303 commit 7bae61b

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎packages/objectql/src/engine-blank-typed-value-door.test.ts‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,9 @@ function makeStubDriver() {
5555
const driver: any = {
5656
name: 'stub', version: '0.0.0', supports: {},
5757
async connect() {}, async disconnect() {}, async checkHealth() { return true; }, async execute() { return null; },
58-
async find(_o: string, q: any) {
59-
const id = idOf(q);
60-
const inIds = q?.where?.id?.$in as string[] | undefined;
61-
const all = [...rows.values()];
62-
if (id) return all.filter((r) => r.id === id);
63-
if (inIds) return all.filter((r) => inIds.includes(r.id as string));
64-
return all;
65-
},
58+
// Not a query-honouring `find`: nothing here reads rows back through it
59+
// (the by-id prior read is `findOne`), so it answers the whole store.
60+
async find() { return [...rows.values()]; },
6661
async findOne(_o: string, q: any) {
6762
const id = idOf(q);
6863
return (id ? rows.get(id) : rows.values().next().value) ?? null;

0 commit comments

Comments
 (0)