Skip to content

Commit 75dee84

Browse files
committed
test(plugins): the #15302 pin doubles hold the caller's limit bound (#15302)
`check:objectql-double-limit` named all three new stub drivers as NEW limit-blind `find` doubles. §3's control passes `limit: 1`, so a blind double would have answered it with the whole table. Bound applied after the filter and by presence, the form the gate names. Also renames the stub's unused `findOne` object parameter: vitest transpiles without checking, so all three suites were green while `tsc --noEmit` (email, webhooks) and `check:test-typecheck` (sharing) each reported TS6133. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpTx2tbq3pZRYAdoGt6E6Y
1 parent f52448f commit 75dee84

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

packages/plugins/plugin-email/src/email-template-provenance.per-row.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ function makeStubDriver(): any {
6464
async execute() { return null; }, async syncSchema() {},
6565
async find(o: string, ast: any) {
6666
d.findCalls.push({ object: o, where: ast?.where });
67-
return [...store.values()].filter((r) => matches(r, ast?.where));
67+
const rows = [...store.values()].filter((r) => matches(r, ast?.where));
68+
// Hold the caller's bound, AFTER the filter and by PRESENCE
69+
// (`check:objectql-double-limit`): §3's control passes `limit: 1`, so a
70+
// limit-blind double would answer it with the whole table.
71+
return typeof ast?.limit === 'number' ? rows.slice(0, ast.limit) : rows;
6872
},
69-
async findOne(o: string, ast: any) {
73+
async findOne(_o: string, ast: any) {
7074
for (const r of store.values()) if (matches(r, ast?.where)) return r;
7175
return null;
7276
},

packages/plugins/plugin-sharing/src/sharing-rule-provenance.per-row.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ function makeStubDriver(): any {
6464
async execute() { return null; }, async syncSchema() {},
6565
async find(o: string, ast: any) {
6666
d.findCalls.push({ object: o, where: ast?.where });
67-
return [...store.values()].filter((r) => matches(r, ast?.where));
67+
const rows = [...store.values()].filter((r) => matches(r, ast?.where));
68+
// Hold the caller's bound, AFTER the filter and by PRESENCE
69+
// (`check:objectql-double-limit`): §3's control passes `limit: 1`, so a
70+
// limit-blind double would answer it with the whole table.
71+
return typeof ast?.limit === 'number' ? rows.slice(0, ast.limit) : rows;
6872
},
69-
async findOne(o: string, ast: any) {
73+
async findOne(_o: string, ast: any) {
7074
for (const r of store.values()) if (matches(r, ast?.where)) return r;
7175
return null;
7276
},

packages/plugins/plugin-webhooks/src/webhook-provenance.per-row.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ function makeStubDriver(): any {
6464
async execute() { return null; }, async syncSchema() {},
6565
async find(o: string, ast: any) {
6666
d.findCalls.push({ object: o, where: ast?.where });
67-
return [...store.values()].filter((r) => matches(r, ast?.where));
67+
const rows = [...store.values()].filter((r) => matches(r, ast?.where));
68+
// Hold the caller's bound, AFTER the filter and by PRESENCE
69+
// (`check:objectql-double-limit`): §3's control passes `limit: 1`, so a
70+
// limit-blind double would answer it with the whole table.
71+
return typeof ast?.limit === 'number' ? rows.slice(0, ast.limit) : rows;
6872
},
69-
async findOne(o: string, ast: any) {
73+
async findOne(_o: string, ast: any) {
7074
for (const r of store.values()) if (matches(r, ast?.where)) return r;
7175
return null;
7276
},

0 commit comments

Comments
 (0)