Skip to content

Commit 1f6cbda

Browse files
committed
test(service-settings): the reach pin's double holds the caller's limit
Claude-Session: https://claude.ai/code/session_014FFTcf6msoLbXiD6BR7wHW Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7813e9d commit 1f6cbda

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/services/service-settings/src/settings-organization-reach.pin.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ function selfBoundDouble(source?: typeof LEAN_ORGANIZATION_SOURCE) {
286286
const where = query?.where ?? {};
287287
const branches: Array<Record<string, unknown>> = Array.isArray(where.$or) ? where.$or : [where];
288288
const { $or: _or, ...rest } = where;
289-
return stored.filter((r) => branches.some((b) => Object.entries({ ...rest, ...b }).every(([k, v]) => (r[k] ?? null) === (v ?? null))));
289+
const hits = stored.filter((r) => branches.some((b) => Object.entries({ ...rest, ...b }).every(([k, v]) => (r[k] ?? null) === (v ?? null))));
290+
return typeof query?.limit === 'number' ? hits.slice(0, query.limit) : hits;
290291
},
291292
async insert(_object: string, data: Record<string, unknown>) { stored.push({ ...data }); return { ...data }; },
292293
async update(_object: string, data: Record<string, unknown>, options?: any) { assertEngineUpdateDispatch(data, options); return 1; },

0 commit comments

Comments
 (0)