Download tasks/codeql_javascript_benchmark_top30_v1/morefixes-312479357bdfa998bf6e/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_javascript_benchmark_top30_v1/morefixes-312479357bdfa998bf6e/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_javascript_benchmark_top30_v1/morefixes-312479357bdfa998bf6e/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_javascript_benchmark_top30_v1/morefixes-312479357bdfa998bf6e/patch.diff
1.22 kB
| diff --git a/apps/web/src/routes/api/$orgSlug/subdomains/index.ts b/apps/web/src/routes/api/$orgSlug/subdomains/index.ts | |
| index cc85588..994952c 100644 | |
| --- a/apps/web/src/routes/api/$orgSlug/subdomains/index.ts | |
| +++ b/apps/web/src/routes/api/$orgSlug/subdomains/index.ts | |
| export const Route = createFileRoute("/api/$orgSlug/subdomains/")({ | |
| const planLimits = getPlanLimits(currentPlan as any); | |
| const subdomainLimit = planLimits.maxSubdomains; | |
| - // Count existing subdomains with a locked read to prevent phantom reads | |
| - const [countResult] = await tx | |
| - .select({ count: sql<number>`count(*)::int` }) | |
| + // Count existing subdomains - lock the rows to prevent race conditions | |
| + const existingSubdomains = await tx | |
| + .select({ id: subdomains.id }) | |
| .from(subdomains) | |
| .where(eq(subdomains.organizationId, organization.id)) | |
| .for("update"); | |
| - const existingCount = countResult?.count ?? 0; | |
| + const existingCount = existingSubdomains.length; | |
| if (subdomainLimit !== -1 && existingCount >= subdomainLimit) { | |
| return { | |