fix(webapp): bound the fixed-length flag key IN filters
CI's oxlint flags an unbounded Prisma `in:` filter: the list length becomes the bind-parameter count, so each distinct length is a separate prepared statement. Both lists here are compile-time constants, but boundedIn is what the neighbouring call sites use and it needs no suppression comment. It pads to the next power of two by repeating the last key, which an IN over a unique column does not notice.
This commit is contained in:
@@ -252,7 +252,7 @@ async function stampGracedGroups(
|
||||
graceMs: number
|
||||
): Promise<Record<string, unknown>> {
|
||||
const existingRows = await tx.featureFlag.findMany({
|
||||
where: { key: { in: GRACED_GLOBAL_KEYS } },
|
||||
where: { key: { in: boundedIn(GRACED_GLOBAL_KEYS) } },
|
||||
select: { key: true, value: true },
|
||||
});
|
||||
const existingGlobal: Record<string, unknown> = {};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import type { ShardKey } from "@trigger.dev/core/v3/isomorphic";
|
||||
import { $replica } from "~/db.server";
|
||||
import { $replica, boundedIn } from "~/db.server";
|
||||
import { env } from "~/env.server";
|
||||
import { logger } from "~/services/logger.server";
|
||||
import { BoundedTtlCache } from "~/services/realtime/boundedTtlCache";
|
||||
@@ -208,7 +208,7 @@ const liveCache = singleton("runOpsMintShardCache", (): { current: MintShardCach
|
||||
|
||||
async function readSetFlags(): Promise<Record<string, unknown>> {
|
||||
const rows = await $replica.featureFlag.findMany({
|
||||
where: { key: { in: GLOBAL_SHARD_KEYS } },
|
||||
where: { key: { in: boundedIn(GLOBAL_SHARD_KEYS) } },
|
||||
select: { key: true, value: true },
|
||||
});
|
||||
const flags: Record<string, unknown> = {};
|
||||
|
||||
Reference in New Issue
Block a user