Skip to content

Conversation

@matt-aitken
Copy link
Member

  • Upgrade Prisma and instrumentation to 6.14.0
  • Move generated artifacts to ./generated folder and update types to fix
  • Added ClickHouse restart handling

@changeset-bot
Copy link

changeset-bot bot commented Aug 27, 2025

⚠️ No Changeset found

Latest commit: 75aa9d8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

Prisma is upgraded to 6.14.0 across packages; client generation now outputs to internal-packages/database/generated/prisma and tracing preview feature removed. decimal.js was added and exported for Decimal. Database exports now re-export from the generated client and transaction types were adjusted (local TransactionIsolationLevel, PrismaClientKnownRequestError usage). Webapp: tighter type-only Prisma imports, added query-performance monitoring with VERY_SLOW_QUERY_THRESHOLD_MS env, and a Uint8Array-based decompression change. Dockerfiles and compose updated for Prisma tooling and clickhouse restart; .gitignore/.dockerignore ignore generated/prisma. Cursor rules globs for services/presenters updated.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch prisma-6-upgrade

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
.cursor/rules/webapp.mdc (1)

34-41: Fix globs and remove duplicates; current patterns won’t match files.

Use recursive globs and dedupe the bullets.

-- All the "services" that are found in app/v3/services/*_/_.server.ts
+- All the "services" that are found in app/v3/services/**/*.server.ts
@@
-- We use "presenters" to move more complex loader code into a class, and you can find those are app/v3/presenters/*_/_.server.ts
+- We use "presenters" to move more complex loader code into a class, and you can find those at app/v3/presenters/**/*.server.ts
@@
-- All the "services" that are found in app/v3/services/*_/_.server.ts
-- The code for the TaskEvent data, which is the otel data sent from tasks to our servers, is in both the [eventRepository.server.ts](mdc:apps/webapp/app/v3/eventRepository.server.ts) and also the [otlpExporter.server.ts](mdc:apps/webapp/app/v3/otlpExporter.server.ts). The otel endpoints which are hit from production and development otel exporters is [otel.v1.logs.ts](mdc:apps/webapp/app/routes/otel.v1.logs.ts) and [otel.v1.traces.ts](mdc:apps/webapp/app/routes/otel.v1.traces.ts)
-- We use "presenters" to move more complex loader code into a class, and you can find those are app/v3/presenters/*_/_.server.ts
+ 
apps/webapp/app/db.server.ts (3)

108-116: Webapp must use env.server.ts for DATABASE_URL (guideline violation)

Replace direct process.env access with env.DATABASE_URL.

Apply:

-  const { DATABASE_URL } = process.env;
-  invariant(typeof DATABASE_URL === "string", "DATABASE_URL env var not set");
+  invariant(typeof env.DATABASE_URL === "string", "DATABASE_URL env var not set");
 
-  const databaseUrl = extendQueryParams(DATABASE_URL, {
+  const databaseUrl = extendQueryParams(env.DATABASE_URL, {

371-372: Use Prisma.raw for dynamic schema identifiers (Prisma.sql usage is incorrect here)

Prisma.sql expects a template tag; for identifiers use Prisma.raw.

Apply:

-export const sqlDatabaseSchema = Prisma.sql([`${DATABASE_SCHEMA}`]);
+export const sqlDatabaseSchema = Prisma.raw(DATABASE_SCHEMA);

140-156: Add missing environment variables and refactor direct process.env access

The new Prisma logging flags aren’t defined in apps/webapp/app/env.server.ts, so we need to:

  1. Define PRISMA_LOG_TO_STDOUT and VERBOSE_PRISMA_LOGS in env.server.ts.
  2. Replace all direct process.env.* usages in apps/webapp/app/db.server.ts with env.*.

• File: apps/webapp/app/env.server.ts

import { z } from "zod"
// …existing exports…

export const PRISMA_LOG_TO_STDOUT = z
  .string()
  .optional()
  .transform((val) => val === "1")

export const VERBOSE_PRISMA_LOGS = z
  .string()
  .optional()
  .transform((val) => val === "1")

export const env = {
  // …other vars
  PRISMA_LOG_TO_STDOUT,
  VERBOSE_PRISMA_LOGS,
}

• File: apps/webapp/app/db.server.ts
Replace each block like:

-      ...((process.env.PRISMA_LOG_TO_STDOUT === "1"
+      ...((env.PRISMA_LOG_TO_STDOUT
         ? [

and

-      ...((process.env.VERBOSE_PRISMA_LOGS === "1"
+      ...((env.VERBOSE_PRISMA_LOGS
         ? [

in the main client (lines 140–156, 157–169) and replica client (lines 252–267, 269–281).

This ensures all environment variables are accessed through the centralized env API as per webapp conventions.

🧹 Nitpick comments (10)
docker/docker-compose.yml (1)

78-82: ClickHouse restart policy added — good resilience; consider pinning image tag

restart: always is a sensible addition for CH stability. As a small hardening, pin image to a version (or digest) to avoid surprise upgrades.

-    image: bitnami/clickhouse:latest
+    image: bitnami/clickhouse:24.8
apps/webapp/app/routes/api.v1.projects.$projectRef.background-workers.$envSlug.$version.ts (1)

85-87: Avoid double Buffer allocation when base64-decoding

Minor simplification and fewer copies.

-function decompressContent(compressedBuffer: Uint8Array): string {
-  // Convert Uint8Array to Buffer and decode base64 in one step
-  const decodedBuffer = Buffer.from(Buffer.from(compressedBuffer).toString("utf-8"), "base64");
+function decompressContent(compressedBuffer: Uint8Array): string {
+  // Convert bytes of the base64 string → actual bytes
+  const base64 = Buffer.from(compressedBuffer).toString("utf8");
+  const decodedBuffer = Buffer.from(base64, "base64");
docker/Dockerfile (2)

41-41: Pin Prisma version via ARG and keep CLI/client in lockstep.

Parameterize the Prisma version and use it here to avoid drift with @prisma/client.

-RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpx [email protected] generate --schema /triggerdotdev/internal-packages/database/prisma/schema.prisma
+RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpx prisma@${PRISMA_VERSION} generate --schema /triggerdotdev/internal-packages/database/prisma/schema.prisma

Add near the start of the production-deps stage:

+ARG PRISMA_VERSION=6.14.0

39-39: Remove stale commented install line.

Dead/commented code adds noise; drop it unless you plan to use it in this build stage.

apps/webapp/app/db.server.ts (1)

210-214: Consider handling $connect() errors explicitly

Unawaited connect can hide startup failures; at least log failures.

Apply:

-  client.$connect();
+  client.$connect().catch((err) => {
+    logger.error("PrismaClient connect failed", { clientType: "writer", err });
+  });

Repeat for replicaClient.$connect().

internal-packages/database/src/transaction.ts (5)

5-10: Avoid drift: derive TransactionIsolationLevel from Prisma types

Manual string union can desync from Prisma.

Option:

- type TransactionIsolationLevel =
-   | "ReadUncommitted"
-   | "ReadCommitted"
-   | "RepeatableRead"
-   | "Serializable";
+ import type { Prisma } from "../generated/prisma";
+ type TransactionIsolationLevel = Prisma.TransactionIsolationLevel;

Also applies to: 67-67


23-25: Transaction client detection may misclassify replica clients

Both PrismaTransactionClient and PrismaReplicaClient are Omit<PrismaClient, "$transaction">, so this runtime check also returns true for a replica client if passed by mistake.

Options:

  • Narrow the param type using the callback’s inferred tx type:
export type PrismaTransactionClient =
  Parameters<Parameters<PrismaClient["$transaction"]>[0]>[0];
  • Or add a runtime guard that asserts the presence of known tx-only symbols and throw if a replica is detected.

Search call sites to ensure $transaction is never called with a replica client.


27-31: Type guard could be stricter

Optional: also check name or use instanceof if safe.

Apply:

-  return (
-    typeof error === "object" && error !== null && "code" in error && typeof error.code === "string"
-  );
+  return (
+    typeof error === "object" &&
+    error !== null &&
+    (error as any).code &&
+    typeof (error as any).code === "string" &&
+    typeof (error as any).message === "string"
+  );

79-111: Add backoff/jitter to retries to avoid thundering herd

Straight immediate retries can amplify contention.

Apply:

-      if (
+      if (
         retryCodes.includes(error.code) &&
         typeof options?.maxRetries === "number" &&
         attempt < options.maxRetries
       ) {
-        return $transaction(prisma, fn, prismaError, options, attempt + 1);
+        const base = 50; // ms
+        const delay = Math.min(1000, base * 2 ** attempt) + Math.floor(Math.random() * 50);
+        await new Promise((r) => setTimeout(r, delay));
+        return $transaction(prisma, fn, prismaError, options, attempt + 1);
       }

113-142: Order-sensitive comparison in isUniqueConstraintError

meta.target order may vary; compare sets instead.

Apply:

-  if (target.length !== columns.length) {
-    return false;
-  }
-
-  for (let i = 0; i < columns.length; i++) {
-    if (target[i] !== columns[i]) {
-      return false;
-    }
-  }
-
-  return true;
+  if (target.length !== columns.length) return false;
+  const targetSet = new Set<string>(target);
+  return (columns as readonly string[]).every((c) => targetSet.has(c));
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 96243ef and 8aaf750.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • references/v3-catalog/package.json is excluded by !references/**
📒 Files selected for processing (12)
  • .cursor/rules/webapp.mdc (2 hunks)
  • apps/webapp/app/db.server.ts (1 hunks)
  • apps/webapp/app/routes/api.v1.projects.$projectRef.background-workers.$envSlug.$version.ts (1 hunks)
  • apps/webapp/package.json (3 hunks)
  • docker/Dockerfile (1 hunks)
  • docker/docker-compose.yml (1 hunks)
  • internal-packages/database/.dockerignore (1 hunks)
  • internal-packages/database/.gitignore (1 hunks)
  • internal-packages/database/package.json (1 hunks)
  • internal-packages/database/prisma/schema.prisma (1 hunks)
  • internal-packages/database/src/index.ts (1 hunks)
  • internal-packages/database/src/transaction.ts (4 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
For TypeScript, we usually use types over interfaces
Avoid enums
No default exports, use function declarations

Files:

  • internal-packages/database/src/index.ts
  • apps/webapp/app/routes/api.v1.projects.$projectRef.background-workers.$envSlug.$version.ts
  • apps/webapp/app/db.server.ts
  • internal-packages/database/src/transaction.ts
internal-packages/database/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

We use prisma in internal-packages/database for our database interactions using PostgreSQL

Files:

  • internal-packages/database/src/index.ts
  • internal-packages/database/src/transaction.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

We use zod a lot in packages/core and in the webapp

Files:

  • apps/webapp/app/routes/api.v1.projects.$projectRef.background-workers.$envSlug.$version.ts
  • apps/webapp/app/db.server.ts
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

apps/webapp/**/*.{ts,tsx}: In the webapp, all environment variables must be accessed through the env export of env.server.ts, instead of directly accessing process.env.
When importing from @trigger.dev/core in the webapp, never import from the root @trigger.dev/core path; always use one of the subpath exports as defined in the package's package.json.

Files:

  • apps/webapp/app/routes/api.v1.projects.$projectRef.background-workers.$envSlug.$version.ts
  • apps/webapp/app/db.server.ts
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
📚 Learning: 2025-07-18T17:49:24.468Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL

Applied to files:

  • internal-packages/database/src/index.ts
  • internal-packages/database/.dockerignore
  • internal-packages/database/.gitignore
  • internal-packages/database/package.json
  • apps/webapp/app/db.server.ts
  • internal-packages/database/src/transaction.ts
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Import Trigger.dev APIs from "trigger.dev/sdk/v3" when writing tasks or related utilities

Applied to files:

  • .cursor/rules/webapp.mdc
📚 Learning: 2025-07-18T17:49:47.180Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-07-18T17:49:47.180Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : When importing from `trigger.dev/core` in the webapp, never import from the root `trigger.dev/core` path; always use one of the subpath exports as defined in the package's package.json.

Applied to files:

  • .cursor/rules/webapp.mdc
📚 Learning: 2025-07-18T17:49:24.468Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp

Applied to files:

  • .cursor/rules/webapp.mdc
📚 Learning: 2025-07-18T17:49:47.180Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-07-18T17:49:47.180Z
Learning: Applies to apps/webapp/app/v3/presenters/**/*.server.ts : Favor the use of 'presenters' to move complex loader code into a class, as seen in `app/v3/presenters/**/*.server.ts`.

Applied to files:

  • .cursor/rules/webapp.mdc
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Do not use client.defineJob or any deprecated v2 patterns (e.g., eventTrigger) when defining tasks

Applied to files:

  • .cursor/rules/webapp.mdc
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Define tasks using task({ id, run, ... }) with a unique id per project

Applied to files:

  • .cursor/rules/webapp.mdc
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use schedules.task(...) for scheduled (cron) tasks; do not implement schedules as plain task() with external cron logic

Applied to files:

  • .cursor/rules/webapp.mdc
📚 Learning: 2025-07-18T17:49:47.180Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-07-18T17:49:47.180Z
Learning: Applies to apps/webapp/app/services/**/*.server.ts : For testable services, separate service logic and configuration, as exemplified by `realtimeClient.server.ts` (service) and `realtimeClientGlobal.server.ts` (configuration).

Applied to files:

  • .cursor/rules/webapp.mdc
🧬 Code graph analysis (1)
internal-packages/database/src/transaction.ts (1)
apps/webapp/app/db.server.ts (3)
  • prisma (100-100)
  • PrismaClientOrTransaction (21-21)
  • PrismaTransactionClient (20-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (12)
apps/webapp/package.json (1)

218-218: @sentry/cli line moved — no functional change

No action needed.

internal-packages/database/.gitignore (1)

4-5: Ignore generated Prisma client — LGTM

Matches generator output path; keeps repo clean. Ensure CI runs prisma generate before build steps.

internal-packages/database/package.json (2)

8-10: Prisma 6.14.0 + decimal.js runtime — aligned and correct

Pinned Prisma versions are consistent; decimal.js inclusion matches code changes.


12-14: Prisma version consistency verified

All occurrences of @prisma/client and prisma across the monorepo are pinned to 6.14.0. No mixed client/runtime versions detected—no further changes needed.

docker/Dockerfile (1)

41-41: All Prisma versions are already aligned at 6.14.x

I’ve confirmed that:

  • docker/Dockerfile pins the Prisma CLI to 6.14.0
  • internal-packages/database has both @prisma/client and prisma at 6.14.0
  • apps/webapp uses @prisma/instrumentation ^6.14.0 (covers 6.14.x)

No mismatches remain—no further changes needed.

internal-packages/database/.dockerignore (1)

1-5: Good call excluding generated client and preserving .env symlink.

This keeps the Docker build context lean and avoids accidental env loss.

internal-packages/database/prisma/schema.prisma (1)

9-9: Output path change aligns with new re-export.

Matches internal-packages/database/src/index.ts and the Docker generate step.

internal-packages/database/src/index.ts (1)

1-1: LGTM.

Re-exporting from generated client matches the new generator output path.

apps/webapp/app/db.server.ts (1)

4-8: Type-only imports and $transaction consolidation look good

Reduces bundle surface and clarifies value vs type usage.

internal-packages/database/src/transaction.ts (3)

1-3: Confirm stability of runtime type import

@prisma/client/runtime/library is semi-internal; verify it’s stable in 6.14.0 or prefer a public type.

Option:

- import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";
+ import type { Prisma } from "../generated/prisma";
+ type PrismaClientKnownRequestError = Prisma.PrismaClientKnownRequestError;

21-21: Confirm Decimal compatibility

Ensure Prisma’s Decimal instances are compatible with decimal.js export for instanceof checks and serialization.

Quick runtime check in a dev shell after upgrading: create a Decimal field row, read it back, and assert value instanceof Decimal.


38-46: Retriable error codes verified — complete set confirmed

Based on the Prisma 6.14.0 error reference, the only known error codes recommended for automatic retry in interactive transactions are:

  • P2024: Connection pool timeout (timed out fetching a new connection)
  • P2028: Transaction API error (e.g., transaction expired or closed)
  • P2034: Transaction conflict or deadlock (write conflict/deadlock)

No additional Prisma-thrown error codes are documented for retrying interactive transactions in version 6.14.0 (prisma.io)

"@opentelemetry/semantic-conventions": "1.25.1",
"@popperjs/core": "^2.11.8",
"@prisma/instrumentation": "^5.11.0",
"@prisma/instrumentation": "^6.14.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

@prisma/instrumentation ^6.14.0 — version aligns with Prisma 6.14.0

Looks good. Please verify OTEL package versions don’t trigger peer warnings at runtime.


🏁 Script executed:

#!/bin/bash
# Check for mismatched OTEL deps that could cause peer warnings
jq -r '.dependencies, .devDependencies | to_entries[] | select(.key|test("^@opentelemetry/")).key + "@" + .value' apps/webapp/package.json
# Grep for Prisma instrumentation registration occurrences
rg -nP '@prisma/instrumentation|PrismaInstrumentation' -C2

Length of output: 7998


Ensure OpenTelemetry dependency versions are fully aligned

  • @prisma/instrumentation ^6.14.0 is correct and matches Prisma 6.14.0.
  • In apps/webapp/package.json we have mixed OTel versions that will trigger peer-dependency warnings:
    • @opentelemetry/[email protected] vs. core/resources/sdk packages at 1.25.1
    • @opentelemetry/instrumentation-express@^0.36.1 vs. @opentelemetry/instrumentation & [email protected]
  • These mismatches will surface at install/runtime. Please bump to a consistent set, for example:
    • “@opentelemetry/api”: “^1.25.1”
    • “@opentelemetry/instrumentation-express”: “^0.52.1”
  • After updating, reinstall (pnpm/yarn) and confirm no peer warnings appear.
🤖 Prompt for AI Agents
In apps/webapp/package.json around line 81 the OpenTelemetry packages are
version-mismatched (e.g. @opentelemetry/[email protected] vs other otel packages at
1.25.1 and @opentelemetry/instrumentation-express@^0.36.1 vs
[email protected]); update package.json to align versions (set
"@opentelemetry/api" to "^1.25.1" and "@opentelemetry/instrumentation-express"
to "^0.52.1", and ensure any other @opentelemetry/* deps use the same
1.25.x/0.52.x family), then reinstall dependencies (pnpm/yarn) and confirm no
peer-dependency warnings at install/runtime.

"dotenv": "^16.4.5",
"effect": "^3.11.7",
"emails": "workspace:*",
"eventsource": "^4.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

New dependency: eventsource — confirm module format and Node support

Ensure it works with your CJS server build and Node engine (>=16). Validate bundling and SSR usage.


🏁 Script executed:

#!/bin/bash
# Where is eventsource used?
rg -nP '\beventsource\b' -C2 apps/webapp | sed -n '1,120p'

# Quick ESM/CJS check via package.json fields (requires network if not installed)
# If workspace is installed, peek installed metadata:
fd -a 'eventsource/package.json' node_modules | xargs -I{} jq '{name:.name,module:.module,main:.main,types:.types,type:.type,engines:.engines}' {}

Length of output: 484


🏁 Script executed:

#!/bin/bash
# Fetch module entrypoints and engine requirements for [email protected]
npm view [email protected] main module type engines --json

Length of output: 645


[email protected] requires Node >= 20 and is published as ESM (with a CJS entrypoint)—verify runtime upgrade or pin to v3

The new “eventsource” dependency ships with

  • "type": "module" (so all .js files are ESM),
  • a CJS entrypoint at main: "./dist/index.cjs",
  • an ESM entrypoint at module: "./dist/index.js",
  • and declares "engines": { "node": ">=20.0.0" }.

This means:

  • At install time, Node versions < 20 will be rejected by npm/yarn.
  • Your CJS-based server can still require('eventsource') (it’ll load the .cjs build), but bundlers/SSR pipelines may need explicit handling of .cjs modules in an ESM package.

Please address:

  • Whether you’re ready to upgrade your Node engine requirement to >= 20.0.0 to satisfy “eventsource”’s engines field.
  • If not, consider pinning to the latest v3.x release (which supports Node >= 10 and is CJS).
  • Confirm your bundler/SSR config correctly includes .cjs files from ESM packages.

• File: apps/webapp/package.json (line 140)
• Dependency: "eventsource": "^4.0.0"

🤖 Prompt for AI Agents
In apps/webapp/package.json around line 140, the dependency "eventsource":
"^4.0.0" requires Node >=20 and ships as ESM with a CJS entrypoint; either
update the project's engine to "node": ">=20.0.0" (and bump CI/build images,
update lockfile and reinstall) if you are ready to run Node 20+, or pin
eventsource to the latest v3.x release (e.g. replace with "^3.x") to retain Node
<20 compatibility; additionally, if you keep v4, ensure your bundler/SSR config
explicitly allows importing .cjs files from ESM packages (adjust module/resolver
rules or transpile/include node_modules .cjs entries) and run a full build/test
to verify SSR and server-side require/import behavior.

Copy link
Collaborator

@nicktrn nicktrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a small comment re dockerignore and rabbit not quite happy yet but looks good otherwise!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal-packages/database/src/transaction.ts (1)

27-31: Type guard too permissive; may misclassify non‑Prisma errors with a string code

Current check matches any error with a string “code” (common in Node), which can incorrectly invoke prismaError() and possibly swallow non‑Prisma errors.

-import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";
+import type { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";
@@
-export function isPrismaKnownError(error: unknown): error is PrismaClientKnownRequestError {
-  return (
-    typeof error === "object" && error !== null && "code" in error && typeof error.code === "string"
-  );
-}
+export function isPrismaKnownError(error: unknown): error is PrismaClientKnownRequestError {
+  // Prefer brand check; falls back to name to be resilient across bundles.
+  return (
+    (typeof error === "object" &&
+      error !== null &&
+      // @ts-expect-error runtime check
+      (error instanceof Prisma.PrismaClientKnownRequestError || error.name === "PrismaClientKnownRequestError"))
+  );
+}
@@
-export async function $transaction<R>(
+export async function $transaction<R>(
   prisma: PrismaClientOrTransaction,
   fn: (prisma: PrismaTransactionClient) => Promise<R>,
-  prismaError: (error: PrismaClientKnownRequestError) => void,
+  prismaError: (error: PrismaClientKnownRequestError) => void,

Also applies to: 3-3, 82-82

♻️ Duplicate comments (2)
apps/webapp/package.json (2)

81-81: Align OpenTelemetry versions to prevent peer warnings

Versions are mixed (api 1.9.0 vs 1.25.1; express instrumentation ^0.36.x vs 0.52.x). Align to the 1.25.x/0.52.x family.

-    "@opentelemetry/api": "1.9.0",
+    "@opentelemetry/api": "^1.25.1",
-    "@opentelemetry/instrumentation-express": "^0.36.1",
+    "@opentelemetry/instrumentation-express": "^0.52.1",
#!/bin/bash
# Verify all @opentelemetry/* versions align
jq -r '.dependencies, .devDependencies | to_entries[] | select(.key|test("^@opentelemetry/")).key + "@" + .value' apps/webapp/package.json

140-140: eventsource@^4 requires Node >=20 — reconcile with engines or pin v3

Your engines currently allow Node >=16. Choose one:

  • Option A (upgrade runtime): Update engines.node to ">=20.0.0".
    Example (outside this hunk):

    { "engines": { "node": ">=20.0.0" } }
  • Option B (keep Node <20): Pin eventsource to v3.

-    "eventsource": "^4.0.0",
+    "eventsource": "^3.0.2",
🧹 Nitpick comments (3)
.dockerignore (1)

19-20: Ignore the entire directory recursively and Prisma engines cache

The current pattern will work, but making it explicit avoids edge cases and reduces context size further.

-**/generated/prisma
+**/generated/prisma/**
+# Also ignore Prisma engines cache that may appear in workspaces
+**/.prisma/**
docker/Dockerfile (1)

39-42: Parameterize Prisma CLI version and keep it in one place

Avoid hardcoding versions in multiple lines; makes future bumps safer.

-# RUN pnpm add @prisma/[email protected] -w
 ENV NPM_CONFIG_IGNORE_WORKSPACE_ROOT_CHECK true
-RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpx [email protected] generate --schema /triggerdotdev/internal-packages/database/prisma/schema.prisma
+ARG PRISMA_VERSION=6.14.0
+# RUN pnpm add @prisma/client@${PRISMA_VERSION} -w
+RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpx prisma@${PRISMA_VERSION} generate --schema /triggerdotdev/internal-packages/database/prisma/schema.prisma
internal-packages/database/src/transaction.ts (1)

5-10: Avoid manual isolation level strings; use Prisma’s type to prevent drift

Relying on a local union risks mismatch with future Prisma changes. Use the official type.

-import { PrismaClient } from "../generated/prisma";
+import { PrismaClient, Prisma } from "../generated/prisma";
@@
-// Define the isolation levels manually
-type TransactionIsolationLevel =
-  | "ReadUncommitted"
-  | "ReadCommitted"
-  | "RepeatableRead"
-  | "Serializable";
+type TransactionIsolationLevel = Prisma.TransactionIsolationLevel;
@@
-  /**  Sets the transaction isolation level. By default this is set to the value currently configured in your database. */
-  isolationLevel?: TransactionIsolationLevel;
+  /**  Sets the transaction isolation level. By default this is set to the value currently configured in your database. */
+  isolationLevel?: TransactionIsolationLevel;

Also applies to: 66-68

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8aaf750 and ffb144d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • .cursor/rules/webapp.mdc (2 hunks)
  • .dockerignore (1 hunks)
  • apps/webapp/app/db.server.ts (1 hunks)
  • apps/webapp/app/routes/api.v1.projects.$projectRef.background-workers.$envSlug.$version.ts (1 hunks)
  • apps/webapp/package.json (3 hunks)
  • docker/Dockerfile (1 hunks)
  • docker/docker-compose.yml (1 hunks)
  • internal-packages/database/.gitignore (1 hunks)
  • internal-packages/database/package.json (1 hunks)
  • internal-packages/database/prisma/schema.prisma (1 hunks)
  • internal-packages/database/src/index.ts (1 hunks)
  • internal-packages/database/src/transaction.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • internal-packages/database/prisma/schema.prisma
  • docker/docker-compose.yml
  • apps/webapp/app/db.server.ts
  • internal-packages/database/src/index.ts
  • internal-packages/database/.gitignore
  • internal-packages/database/package.json
  • .cursor/rules/webapp.mdc
  • apps/webapp/app/routes/api.v1.projects.$projectRef.background-workers.$envSlug.$version.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
For TypeScript, we usually use types over interfaces
Avoid enums
No default exports, use function declarations

Files:

  • internal-packages/database/src/transaction.ts
internal-packages/database/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

We use prisma in internal-packages/database for our database interactions using PostgreSQL

Files:

  • internal-packages/database/src/transaction.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
📚 Learning: 2025-07-18T17:49:24.468Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL

Applied to files:

  • internal-packages/database/src/transaction.ts
🧬 Code graph analysis (1)
internal-packages/database/src/transaction.ts (1)
apps/webapp/app/db.server.ts (3)
  • prisma (100-100)
  • PrismaClientOrTransaction (21-21)
  • PrismaTransactionClient (20-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: units / packages / 📊 Merge Reports
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: typecheck / typecheck
🔇 Additional comments (2)
apps/webapp/package.json (1)

218-218: Move @sentry/cli to devDependencies — LGTM

This reduces prod image size and attack surface.

internal-packages/database/src/transaction.ts (1)

21-21: Decimal re-export — LGTM

Switching to decimal.js aligns with Prisma 6 runtime. Ensure decimal.js is a runtime dep of this package (it is per PR).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/webapp/app/db.server.ts (1)

1-399: Replace direct process.env.VERY_SLOW_QUERY_THRESHOLD_MS usages with the env wrapper

Direct references to process.env.VERY_SLOW_QUERY_THRESHOLD_MS were found in two places and should be updated to use the imported env object for consistency and type safety:

• apps/webapp/app/db.server.ts:159
• apps/webapp/app/db.server.ts:282

Suggested diff:

-  ...(process.env.VERBOSE_PRISMA_LOGS === "1" ||
-  process.env.VERY_SLOW_QUERY_THRESHOLD_MS !== undefined
+  ...(env.VERBOSE_PRISMA_LOGS === "1" ||
+  env.VERY_SLOW_QUERY_THRESHOLD_MS !== undefined

Make sure to update both the writer and replica client configurations accordingly.

🧹 Nitpick comments (5)
apps/webapp/app/utils/queryPerformanceMonitor.server.ts (3)

4-7: Prefer type alias over interface per repo guidelines

Use a type alias to match our TS style in webapp.

-export interface QueryPerformanceConfig {
+export type QueryPerformanceConfig = {
   verySlowQueryThreshold?: number; // ms
   maxQueryLogLength: number;
-}
+}

35-52: Make param detection robust and avoid brittle string checks

Parse Prisma’s params payload when possible; fall back to regex. Also derive hasParams from the computed count.

-    if (duration > this.config.verySlowQueryThreshold) {
-      // Truncate long queries for readability
+    if (duration > this.config.verySlowQueryThreshold) {
+      const paramCount = this.countParams(query, params);
+      // Truncate long queries for readability
       const truncatedQuery =
         query.length > this.config.maxQueryLogLength
           ? query.substring(0, this.config.maxQueryLogLength) + "..."
           : query;

       logger.error("Prisma: very slow database query", {
         clientType,
         durationMs: duration,
         query: truncatedQuery,
         target,
         timestamp,
-        paramCount: this.countParams(query),
-        hasParams: params !== "[]" && params !== "",
+        paramCount,
+        hasParams: paramCount > 0,
       });
     }

55-59: Enhance countParams to use params JSON and support both $n and ? placeholders

This improves accuracy across drivers and Prisma formats.

-  private countParams(query: string): number {
-    // Count the number of $1, $2, etc. parameters in the query
-    const paramMatches = query.match(/\$\d+/g);
-    return paramMatches ? paramMatches.length : 0;
-  }
+  private countParams(query: string, paramsStr?: string): number {
+    // Prefer parsing Prisma's params payload if it's JSON-like
+    if (paramsStr) {
+      try {
+        const parsed = JSON.parse(paramsStr);
+        if (Array.isArray(parsed)) return parsed.length;
+        if (parsed && typeof parsed === "object") return Object.keys(parsed).length;
+      } catch {
+        // fall through to regex-based heuristics
+      }
+    }
+    // Heuristics: count $1, $2... (Postgres) or ? placeholders
+    const dollarParams = query.match(/\$\d+/g)?.length ?? 0;
+    const qmarkParams = query.match(/\?/g)?.length ?? 0;
+    return Math.max(dollarParams, qmarkParams);
+  }
apps/webapp/app/db.server.ts (2)

168-175: Optional: move VERBOSE_PRISMA_LOGS to env schema for consistency

If we want zero direct process.env usage in webapp, add VERBOSE_PRISMA_LOGS to EnvironmentSchema and consume via env.


291-298: Optional: same VERBOSE_PRISMA_LOGS consistency on replica

Consider routing via env schema.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ffb144d and 75aa9d8.

📒 Files selected for processing (3)
  • apps/webapp/app/db.server.ts (5 hunks)
  • apps/webapp/app/env.server.ts (1 hunks)
  • apps/webapp/app/utils/queryPerformanceMonitor.server.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
For TypeScript, we usually use types over interfaces
Avoid enums
No default exports, use function declarations

Files:

  • apps/webapp/app/utils/queryPerformanceMonitor.server.ts
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/db.server.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

We use zod a lot in packages/core and in the webapp

Files:

  • apps/webapp/app/utils/queryPerformanceMonitor.server.ts
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/db.server.ts
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

apps/webapp/**/*.{ts,tsx}: In the webapp, all environment variables must be accessed through the env export of env.server.ts, instead of directly accessing process.env.
When importing from @trigger.dev/core in the webapp, never import from the root @trigger.dev/core path; always use one of the subpath exports as defined in the package's package.json.

Files:

  • apps/webapp/app/utils/queryPerformanceMonitor.server.ts
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/db.server.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
📚 Learning: 2025-07-18T17:49:24.468Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T17:49:24.468Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL

Applied to files:

  • apps/webapp/app/db.server.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
apps/webapp/app/env.server.ts (1)

1083-1085: Env var addition looks good

Optional numeric threshold with coercion aligns with how other timing envs are defined.

apps/webapp/app/utils/queryPerformanceMonitor.server.ts (1)

62-64: LGTM: env-driven threshold wiring

Singleton configured from env keeps this opt-in by default.

apps/webapp/app/db.server.ts (4)

4-9: Type-only imports and $transaction aliasing look correct

This reduces type bloat and keeps the runtime alias consistent.


18-18: LGTM: query performance monitor integration

Import placement and usage are appropriate.


216-220: LGTM: writer query event hook

Listener is safe; emits only when query events are enabled.


338-342: LGTM: replica query event hook

Symmetric with writer, correct clientType passed.

@matt-aitken matt-aitken merged commit 24a9151 into main Aug 27, 2025
31 checks passed
@matt-aitken matt-aitken deleted the prisma-6-upgrade branch August 27, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants