Skip to content

Commit c4c64fd

Browse files
committed
test(plugin-approvals): the cross-org refusal pins' engine double honours limit and carries no write verbs it is never sent
The node under these pins never updates or deletes through the engine, so the double declares neither, and its find cuts at the caller's limit as the engine does. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CXqXpuVf14Mqo1pznh
1 parent 50deed3 commit c4c64fd

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎packages/plugins/plugin-approvals/src/approver-directory-refusal-cross-org.test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ function makeEngine(seed: Record<string, Row[]>) {
5353
return {
5454
_tables: tables,
5555
async find(object: string, options?: any) {
56-
return ensure(object).filter((r) => matches(r, options?.filter ?? options?.where));
56+
const rows = ensure(object).filter((r) => matches(r, options?.filter ?? options?.where));
57+
return typeof options?.limit === 'number' ? rows.slice(0, options.limit) : rows;
5758
},
5859
async insert(object: string, data: Row) { ensure(object).push({ ...data }); return { ...data }; },
59-
async update() { return {}; },
60-
async delete() { return {}; },
6160
async count(object: string) { return ensure(object).length; },
6261
registerHook() { /* no-op */ },
6362
unregisterHooksByPackage() { /* no-op */ },

0 commit comments

Comments
 (0)