Skip to content

chore: fix lint warnings - #4605

Merged
carderne merged 1 commit into
mainfrom
fix-lint-warnings
Aug 13, 2026
Merged

chore: fix lint warnings#4605
carderne merged 1 commit into
mainfrom
fix-lint-warnings

Conversation

@carderne

Copy link
Copy Markdown
Collaborator

No description provided.

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6a4dcf8

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

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c43e608d-934a-468b-8f2e-e7d06a520930

📥 Commits

Reviewing files that changed from the base of the PR and between 6485f37 and 26fe553.

📒 Files selected for processing (4)
  • .oxlintrc.json
  • apps/webapp/seed-queue-metrics.mts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
  • apps/webapp/test/helpers/sessionStream.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout. (18)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (12, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (11, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 12)
  • GitHub Check: runops-guard / runops-guard
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: typecheck / typecheck
  • GitHub Check: code-quality / code-quality
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx}

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

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

**/*.{ts,tsx}: Prefer static imports over dynamic import(); use dynamic imports only for unresolvable circular dependencies, genuine performance code splitting, or conditional runtime loading.
Import Trigger.dev tasks from @trigger.dev/sdk; never use @trigger.dev/sdk/v3 or deprecated client.defineJob.
Add agentcrumbs while writing code using approved namespaces; mark lines with // @Crumbs or blocks with `// `#region` `@crumbs, and strip them before merging.

Files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

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

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
**/*.{ts,tsx,js,jsx}

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

Use function declarations instead of default exports

Files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/otel-metrics.mdc)

**/*.ts: When creating or editing OTEL metrics (counters, histograms, gauges), ensure metric attributes have low cardinality by using only enums, booleans, bounded error codes, or bounded shard IDs
Do not use high-cardinality attributes in OTEL metrics such as UUIDs/IDs (envId, userId, runId, projectId, organizationId), unbounded integers (itemCount, batchSize, retryCount), timestamps (createdAt, startTime), or free-form strings (errorMessage, taskName, queueName)
When exporting OTEL metrics via OTLP to Prometheus, be aware that the exporter automatically adds unit suffixes to metric names (e.g., 'my_duration_ms' becomes 'my_duration_ms_milliseconds', 'my_counter' becomes 'my_counter_total'). Account for these transformations when writing Grafana dashboards or Prometheus queries

Files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
apps/webapp/**/*.{ts,tsx}

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

apps/webapp/**/*.{ts,tsx}: Access environment variables through the env export of env.server.ts instead of directly accessing process.env
Use subpath exports from @trigger.dev/core package instead of importing from the root @trigger.dev/core path

Do not reintroduce the removed v1 execution path; RunEngineVersion.V1 branches may only reject or finalize gracefully so v3 clients receive a clean 4xx, never a 5xx.

Files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
apps/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

For apps, use typecheck for verification and never use build as the correctness check.

Files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
**/*.{test,spec}.{ts,tsx}

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

Use vitest for all tests in the Trigger.dev repository

**/*.{test,spec}.{ts,tsx}: Use Vitest exclusively and never mock dependencies; use Testcontainers for integration dependencies.
Place test files next to the source files they test.

Files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
apps/webapp/**/*.test.{ts,tsx}

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

Do not import env.server.ts directly or indirectly into test files; instead pass environment-dependent values through options/parameters to make code testable

Files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
apps/webapp/**/*.{test,spec}.{ts,tsx}

📄 CodeRabbit inference engine (apps/webapp/CLAUDE.md)

Test files must not import app/env.server.ts; pass configuration as options instead.

Files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
🧠 Learnings (56)
📓 Common learnings
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3561
File: .claude/scripts/check-review-md.sh:76-79
Timestamp: 2026-05-12T14:13:17.114Z
Learning: In the triggerdotdev/trigger.dev repository, `.claude/REVIEW.md` drift/audit checking is handled by an LLM-based workflow using `anthropics/claude-code-action` (mirroring `.github/workflows/claude-md-audit.yml`), not a static bash script. The LLM audit catches semantic drift, stale references, contradictions, and missing/obsolete rules — not just deleted paths. The bash script `.claude/scripts/check-review-md.sh` was dropped in favor of this approach.
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3642
File: CONTRIBUTING.md:76-78
Timestamp: 2026-05-16T12:10:39.040Z
Learning: In `CONTRIBUTING.md` for the triggerdotdev/trigger.dev repo, all fenced code blocks intentionally use bare ``` with no language specifier. Do not flag individual blocks for missing language identifiers — any fix should be a file-wide sweep, not a per-block change.
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 4124
File: internal-packages/database/prisma/migrations/20260629120000_drop_run_ops_control_plane_foreign_keys/migration.sql:1-26
Timestamp: 2026-07-02T19:14:58.851Z
Learning: Repo triggerdotdev/trigger.dev: In the run-ops DB split (schema.prisma / internal-packages/database/prisma/migrations), the intentional pattern is to keep Prisma `relation` declarations on models like TaskRun, Waitpoint, TaskRunWaitpoint, TaskRunCheckpoint, TaskRunAttempt, TaskRunTag, and WaitpointTag even after dropping the corresponding DB-level foreign key constraints via migration (e.g., migrations under 20260629120000_drop_run_ops_control_plane_foreign_keys and related). This is not schema drift: on the dedicated run-ops DB, `internal-packages/run-store/src/PostgresRunStore.ts` uses `stripDedicatedRelations` to strip these relation keys from Prisma select/include before querying, then `#hydrateDedicatedRelations` re-populates them from scalar columns or join lookups (e.g., hydrateAssociatedWaitpoint, hydrateBlockingTaskRuns). Do not flag missing schema updates to remove `relation` fields when FK constraints are dropped in this codebase's run-ops split migrations.
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3545
File: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.playground.$agentParam/route.tsx:59-59
Timestamp: 2026-05-14T14:56:06.298Z
Learning: In triggerdotdev/trigger.dev, `trigger.dev/core/v3` is a known codebase-wide import convention violation across `apps/webapp`. The correct approach is to use narrow, dedicated subpath imports. Specifically:
- `generateJWT` should be imported from `trigger.dev/core/v3/jwt`
- `MachinePresetName` should be imported from `trigger.dev/core/v3/schemas`
Do not flag individual `trigger.dev/core/v3` occurrences in the webapp as isolated bugs; the full migration is tracked as a follow-up refactor.
📚 Learning: 2025-11-27T16:26:37.432Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T16:26:37.432Z
Learning: Applies to **/tsconfig.json : Use strict mode in TypeScript configuration

Applied to files:

  • .oxlintrc.json
📚 Learning: 2026-04-13T21:43:58.707Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3368
File: apps/webapp/app/services/taskIdentifierRegistry.server.ts:49-58
Timestamp: 2026-04-13T21:43:58.707Z
Learning: In `apps/webapp/app/services/taskIdentifierRegistry.server.ts` (and closely related task registry/sync code in this module), an empty deployment (zero tasks) is not a realistic/expected scenario. Do not flag or require special handling or fallback logic for missing empty-task cases in this registry/sync flow.

Applied to files:

  • .oxlintrc.json
📚 Learning: 2026-04-23T13:26:27.529Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3430
File: apps/webapp/app/presenters/v3/RunStreamPresenter.server.ts:0-0
Timestamp: 2026-04-23T13:26:27.529Z
Learning: In this codebase’s SSE implementation (notably `apps/webapp/app/utils/sse.ts` and its SSE callers such as `apps/webapp/app/presenters/v3/RunStreamPresenter.server.ts`), do not treat `.abort()` vs `.abort("<reason string>")` differences as a heap retention/memory leak issue on Node 20. Heap deltas are identical once `AbortSignal.any` is not involved; the investigated SSE memory leak root cause was `AbortSignal.any` (via FinalizationRegistry behavior on abort). When reviewing, focus on whether `AbortSignal.any` (or similar signal-combining/finalization patterns) is used in the SSE abort path rather than the presence/contents of the abort reason string. Named abort-reason sentinel constants (e.g., `ABORT_REASON_*`) are for readability/style only, not correctness.

Applied to files:

  • .oxlintrc.json
📚 Learning: 2026-04-30T21:28:35.705Z
Learnt from: samejr
Repo: triggerdotdev/trigger.dev PR: 3473
File: internal-packages/database/prisma/schema.prisma:59-60
Timestamp: 2026-04-30T21:28:35.705Z
Learning: In this repo, session-duration lower-bound validation is intentionally enforced only at the app layer (via `isAllowedSessionDuration` and `SESSION_DURATION_OPTIONS`), where the minimum allowed value is 300 seconds (5 minutes). `User.sessionDuration` is `Int` (non-nullable) and `Organization.maxSessionDuration` is `Int?` (nullable). There are currently no DB-level `CHECK` constraints for these fields anywhere in the migrations, so future reviews should not flag the absence of DB `CHECK` constraints on these session-duration fields—focus validation on the app-layer logic instead.

Applied to files:

  • .oxlintrc.json
📚 Learning: 2026-05-12T06:43:09.116Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3558
File: internal-packages/run-engine/src/run-queue/index.ts:420-424
Timestamp: 2026-05-12T06:43:09.116Z
Learning: In internal-packages/run-engine/src/run-queue/index.ts, the RunQueue “read-path” counter/concurrency methods (e.g., lengthOfQueue/lengthOfQueues/currentConcurrencyOfQueues) intentionally “fail open” on transient Redis pipeline result errors. If you see pipeline result errors (e.g., baseErr/ctrErr) being coerced to 0 (treating Redis command errors the same as missing keys) rather than surfaced/thrown, do not flag it as a bug and do not suggest propagating those errors in future reviews.

Applied to files:

  • .oxlintrc.json
📚 Learning: 2026-05-19T21:04:49.990Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3671
File: packages/trigger-sdk/src/v3/ai.ts:724-769
Timestamp: 2026-05-19T21:04:49.990Z
Learning: In packages/trigger-sdk/src/v3/ai.ts, when reviewing recovery/replay of turns, do NOT flag “lost metadata on recovered turns” if the recovered turns are reconstructed via the recovery boot queue that maps metadata by message.id (using replaySessionInTail’s {message, metadata, seqNum} per session.in record). If a message has no matching session.in record (e.g., hook-synthesized messages), the code intentionally falls back to the current boot payload’s metadata—this fallback is expected behavior.

Applied to files:

  • .oxlintrc.json
📚 Learning: 2026-04-27T16:46:05.550Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3456
File: apps/webapp/package.json:152-152
Timestamp: 2026-04-27T16:46:05.550Z
Learning: In `apps/webapp`, the `effect` npm package is an intentional runtime dependency used in `apps/webapp/app/utils/updateMetadata.server.ts` (and related modules) for Schedule + Fiber-based metadata update logic. Specifically, the four Effect API usages are: `Duration.divide`, `STM.cond`, namespace exports for `Effect`/`Schedule`/`Duration`/`Fiber`, and the `Fiber.RuntimeFiber` type. Do not flag `effect` as an unused or misplaced dependency in `apps/webapp/package.json`.

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-08-02T02:37:23.165Z
Learnt from: 1stvamp
Repo: triggerdotdev/trigger.dev PR: 4455
File: internal-packages/observability-map/src/mutationCorpus.test.ts:1-37
Timestamp: 2026-08-02T02:37:23.165Z
Learning: In `internal-packages/observability-map`, Vitest test modules use the `__dirname` value injected by Vitest. Keep `__dirname` in package test files such as `mutationCorpus.test.ts`, `webappSymbols.test.ts`, `integration.test.ts`, `scan.test.ts`, and `docstringReferences.test.ts`. Use `import.meta.url` in program entry points that run outside Vitest, including `cli.ts` and `report/prCommentCli.ts`.

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-07-15T18:37:08.044Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: apps/webapp/CLAUDE.md:0-0
Timestamp: 2026-07-15T18:37:08.044Z
Learning: Applies to apps/webapp/app/v3/services/{triggerTask,batchTriggerV3}.server.ts : Do not add database queries to `triggerTask.server.ts` or `batchTriggerV3.server.ts`; reuse the existing queue query and preserve the two-stage trigger-time/dequeue-time resolution pattern. Add task defaults to the existing `select` clause or resolve them at dequeue time.

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2025-11-27T16:26:37.432Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T16:26:37.432Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : Use Prisma for database interactions in internal-packages/database with PostgreSQL

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-03-25T15:29:25.889Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2026-03-25T15:29:25.889Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Import from `trigger.dev/sdk` (NEVER from `trigger.dev/sdk/v3`)

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-07-13T14:51:40.805Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-07-13T14:51:40.805Z
Learning: Applies to **/*.{ts,tsx} : Import Trigger.dev tasks from `trigger.dev/sdk`; never use `trigger.dev/sdk/v3` or deprecated `client.defineJob`.

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-05-12T21:04:11.286Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3542
File: apps/webapp/app/components/sessions/v1/SessionStatus.tsx:1-3
Timestamp: 2026-05-12T21:04:11.286Z
Learning: In the triggerdotdev/trigger.dev codebase (Remix + TypeScript), importing a type from a `.server.ts` module using `import { type Foo }` or `import type { Foo }` is safe and a standard pattern. TypeScript erases type-only imports completely at compile time — they produce no JavaScript output and therefore never cross the Remix server/client bundle boundary. Do not flag `import { type X } from "*.server"` as a server/client boundary violation.

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2025-11-27T16:26:37.432Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T16:26:37.432Z
Learning: Applies to packages/trigger-sdk/**/*.{ts,tsx} : In the Trigger.dev SDK (packages/trigger-sdk), prefer isomorphic code like fetch and ReadableStream instead of Node.js-specific code

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-07-13T14:51:27.502Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: internal-packages/database/CLAUDE.md:0-0
Timestamp: 2026-07-13T14:51:27.502Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : Use `$replica` from `~/db.server` for read-heavy queries in the webapp.

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-06-19T15:46:51.996Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3990
File: internal-packages/run-store/tsconfig.json:3-7
Timestamp: 2026-06-19T15:46:51.996Z
Learning: In the trigger.dev monorepo, internal packages (e.g., `internal/run-store`, `run-engine`, `run-queue`, `schedule-engine`) use a TypeScript project-references layout where the root `tsconfig.json` is references-only (lists `tsconfig.src.json` and `tsconfig.test.json` as references) and is inert as a compile target. The `strict: true` setting lives in `tsconfig.src.json`, which is what actually compiles `src/**`. Do not flag the root `tsconfig.json` for missing `strict` mode — it intentionally omits compiler options that affect compilation.

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2025-11-27T16:26:37.432Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T16:26:37.432Z
Learning: The SDK at packages/trigger-sdk is an isomorphic TypeScript SDK

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-04-17T13:56:37.517Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3333
File: apps/webapp/app/services/queryService.server.ts:278-279
Timestamp: 2026-04-17T13:56:37.517Z
Learning: In `apps/webapp/app/services/queryService.server.ts`, the `queryConcurrencyLimiter` is intentionally keyed by `projectId` (not `organizationId`), even though the ClickHouse client is organization-scoped. Concurrency control is deliberately enforced at the project level. Do not flag the `projectId` key in `queryConcurrencyLimiter.acquire`/`release` as a bug or suggest changing it to `organizationId`.

Applied to files:

  • apps/webapp/seed-queue-metrics.mts
📚 Learning: 2026-05-14T16:39:02.759Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3546
File: packages/cli-v3/src/mcp/tools/agentChat.ts:29-29
Timestamp: 2026-05-14T16:39:02.759Z
Learning: In `packages/cli-v3/src/mcp/tools/agentChat.ts`, the `activeSessions` Map intentionally has no TTL, LRU eviction, or size limit. The MCP server is dev-only (`start_agent_chat` enforces `input.environment === "dev"`) and runs as a short-lived subprocess of the MCP host (Claude Code / Cursor / etc.). The process is restarted whenever the IDE restarts, so sessions never accumulate across host lifetimes. Do not flag the lack of automatic cleanup as a memory-leak risk in this file.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
📚 Learning: 2026-04-23T13:26:31.290Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3430
File: apps/webapp/app/presenters/v3/RunStreamPresenter.server.ts:0-0
Timestamp: 2026-04-23T13:26:31.290Z
Learning: In `apps/webapp/app/utils/sse.ts` (and callers such as `apps/webapp/app/presenters/v3/RunStreamPresenter.server.ts`), the string-reason type passed to `.abort()` is NOT load-bearing for heap retention in SSE streams on Node 20. Isolation testing (2000 requests × 200 KB payload) confirmed `.abort()` vs `.abort("string")` produces identical heap deltas once `AbortSignal.any` is removed. The actual root cause of the SSE memory leak was `AbortSignal.any`, which registers signals with a FinalizationRegistry that does not reliably release them on abort (see nodejs/node#54614 and `#55351`). Named sentinel constants (`ABORT_REASON_*`, exported from `sse.ts`) are a readability/style win per the CLAUDE.md named-constant guideline, not a correctness fix. Do not flag `.abort()` vs `.abort("reason string")` as a memory-retention issue in future reviews of this codebase.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
📚 Learning: 2026-04-16T13:24:09.546Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3399
File: apps/webapp/app/services/realtime/redisRealtimeStreams.server.ts:26-42
Timestamp: 2026-04-16T13:24:09.546Z
Learning: In `apps/webapp/app/services/realtime/redisRealtimeStreams.server.ts`, `RedisRealtimeStreams` is only ever instantiated once as a process-wide singleton via `singleton("realtimeStreams", initializeRedisRealtimeStreams)` in `apps/webapp/app/services/realtime/v1StreamsGlobal.server.ts` (line 30). Therefore, the instance-level `_sharedRedis` field and `sharedRedis` getter are effectively process-scoped. Do not flag them as a per-request connection leak. The v2 streaming path uses a completely separate class (`S2RealtimeStreams`).

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
📚 Learning: 2026-07-11T08:52:32.250Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 4234
File: apps/webapp/app/routes/realtime.v1.sessions.$session.$io.append.ts:159-164
Timestamp: 2026-07-11T08:52:32.250Z
Learning: In `apps/webapp/app/routes/realtime.v1.sessions.$session.$io.append.ts`, when the idempotency claim via `claimSessionStreamPart()` is lost (i.e., `wonClaim` is false, indicating a duplicate/retried append with the same client-supplied part id), the response omits `seq`, so the SDK's `appendInputChunk()` falls back to the legacy no-baseline behavior for turn-complete correlation in `packages/trigger-sdk/src/v3/chat.ts`. This is accepted as a known, narrow limitation (not a regression) rather than being fixed immediately: `claimSessionStreamPart()` currently only returns a boolean and cannot recover the already-committed seq. The tracked follow-up fix is to have the winner record the committed seq in the dedupe key so the loser can read it back on a lost claim.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
📚 Learning: 2026-07-27T15:07:14.579Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 4397
File: apps/webapp/test/batchStreamGrants.test.ts:0-0
Timestamp: 2026-07-27T15:07:14.579Z
Learning: In `triggerdotdev/trigger.dev`, `apps/webapp/test/authorizationRateLimitMiddleware.test.ts` remains skipped because correcting its plaintext Redis fixture setup (`tlsDisabled`) exposed a timing-sensitive sliding-window test based on real 10-second windows. The new authorization-rate-limit bypass coverage instead lives in the unskipped, deterministic `apps/webapp/test/authorizationRateLimitMiddlewareBypass.test.ts`. Do not flag the legacy suite's continued skip as missing coverage for the bypass behavior.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-07-18T13:08:46.931Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 4284
File: apps/webapp/app/services/realtime/sessionRunManager.server.ts:481-484
Timestamp: 2026-07-18T13:08:46.931Z
Learning: In `apps/webapp/app/services/realtime/sessionRunManager.server.ts`, `getRunStatusAndFriendlyId` intentionally reads from `$replica` on the steady-state append hot path. S2 input streams use `canonicalSessionAddressingKey` keyed by a session externalId/friendlyId rather than a run ID, so appends remain durable even when a stale replica reports a terminal run as non-final. After replica catch-up, a subsequent `ensureRunForSession` detects the terminal run, triggers a continuation, and its boot gate replays the durable `session.in` tail. Do not require a primary re-check for every non-final replica result solely to prevent data loss; the tradeoff is accepted. A trailing fire-and-forget append can remain pending until a later call, which is a known latency consideration.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
📚 Learning: 2026-04-16T14:07:46.808Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3399
File: apps/webapp/app/services/realtime/redisRealtimeStreams.server.ts:282-291
Timestamp: 2026-04-16T14:07:46.808Z
Learning: In `apps/webapp/app/services/realtime/redisRealtimeStreams.server.ts` (`streamResponse`), the pattern `signal.addEventListener("abort", cleanup, { once: true })` does NOT need an explicit `removeEventListener` call in the non-abort cleanup paths (inactivity, cancel). The `AbortController` is per-request, scoped to `httpAsyncStorage` (created in `apps/webapp/server.ts` per-request middleware), so it gets GC'd when the request ends — taking the listener and closure with it. The `isCleanedUp` guard prevents double-execution, and `redis.disconnect()` is called before the request ends. Do not flag this as a listener/closure leak.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
📚 Learning: 2026-04-20T15:05:59.661Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3417
File: apps/webapp/app/routes/realtime.v1.sessions.$session.$io.append.ts:20-31
Timestamp: 2026-04-20T15:05:59.661Z
Learning: In `apps/webapp/app/routes/realtime.v1.sessions.$session.$io.append.ts`, the `MAX_APPEND_BODY_BYTES` cap is intentionally set to `1024 * 512` (512 KiB). The maintainer explicitly decided against lowering it to 128 KiB: the all-quotes worst-case JSON-escaping expansion that could exceed S2's 1 MiB per-record limit is considered pathological and not representative of real-world payloads (chat tokens, tool-call JSON, structured data). If overflow becomes a problem in practice, the preferred mitigation is an encoded-size guard inside `appendPart` itself. Do not flag this cap as a potential S2 overflow issue in future reviews.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
📚 Learning: 2026-05-17T08:07:25.757Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3644
File: apps/webapp/app/services/realtime/s2realtimeStreams.server.ts:261-293
Timestamp: 2026-05-17T08:07:25.757Z
Learning: In `apps/webapp/app/services/realtime/s2realtimeStreams.server.ts`, do NOT suggest adding per-element Zod validation inside `parseSSEBatchRecords()` or `#peekIsSettled()` for S2 batch record entries. S2 records arrive from a trusted upstream in a documented wire format; the existing `try/catch` around `JSON.parse` and the outer batch loop is the intended and sufficient level of defensiveness. Per-element Zod schema validation on every batch record is considered over-engineering for this server-to-server path.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
📚 Learning: 2026-03-22T13:26:12.060Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3244
File: apps/webapp/app/components/code/TextEditor.tsx:81-86
Timestamp: 2026-03-22T13:26:12.060Z
Learning: In the triggerdotdev/trigger.dev codebase, do not flag `navigator.clipboard.writeText(...)` calls for `missing-await`/`unhandled-promise` issues. These clipboard writes are intentionally invoked without `await` and without `catch` handlers across the project; keep that behavior consistent when reviewing TypeScript/TSX files (e.g., usages like in `apps/webapp/app/components/code/TextEditor.tsx`).

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-03-22T19:24:14.403Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3187
File: apps/webapp/app/v3/services/alerts/deliverErrorGroupAlert.server.ts:200-204
Timestamp: 2026-03-22T19:24:14.403Z
Learning: In the triggerdotdev/trigger.dev codebase, webhook URLs are not expected to contain embedded credentials/secrets (e.g., fields like `ProjectAlertWebhookProperties` should only hold credential-free webhook endpoints). During code review, if you see logging or inclusion of raw webhook URLs in error messages, do not automatically treat it as a credential-leak/secrets-in-logs issue by default—first verify the URL does not contain embedded credentials (for example, no username/password in the URL, no obvious secret/token query params or fragments). If the URL is credential-free per this project’s conventions, allow the logging.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-05-18T08:21:27.694Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3632
File: apps/webapp/sentry.server.ts:4-21
Timestamp: 2026-05-18T08:21:27.694Z
Learning: When handling Prisma error P1001 ("Can't reach database server") in TypeScript, don’t assume a single error shape. Prisma can surface P1001 via two different error classes/fields: `PrismaClientKnownRequestError` exposes it as `err.code === "P1001"` (common during mid-query connection drops), while `PrismaClientInitializationError` exposes it as `err.errorCode === "P1001"` (common on client startup failure). Therefore, predicates should use `err.code === "P1001" || err.errorCode === "P1001"`. Do not flag `err.code === "P1001"` as “unreachable/never matches,” as it is expected in production.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-05-18T08:21:27.694Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3632
File: apps/webapp/sentry.server.ts:4-21
Timestamp: 2026-05-18T08:21:27.694Z
Learning: When handling Prisma errors for P1001 ("Can't reach database server"), do not assume it only appears under a single property name. Prisma may surface P1001 via either `PrismaClientKnownRequestError` (`err.code === "P1001"`, e.g., mid-query connection drops) or `PrismaClientInitializationError` (`err.errorCode === "P1001"`, e.g., client startup connection failure). To reliably detect the condition, check `err.code === "P1001" || err.errorCode === "P1001"`, and avoid review rules that would incorrectly flag `err.code === "P1001"` as unreachable/never-matching.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-06-13T19:53:13.759Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3937
File: packages/trigger-sdk/skills/realtime-and-frontend/SKILL.md:258-260
Timestamp: 2026-06-13T19:53:13.759Z
Learning: When reviewing code that uses `trigger.dev/react-hooks`’s `useRealtimeRun`, preserve the call signature where the first argument is the full realtime handle object (not `handle.id`). This is intentional to maintain type-safety and is consistent with the official docs; do not suggest changing the first argument from the handle object to `handle.id`.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-06-17T17:13:49.929Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 3948
File: apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx:48-62
Timestamp: 2026-06-17T17:13:49.929Z
Learning: In triggerdotdev/trigger.dev, within `dashboardLoader`/`dashboardAction` (or similar context resolver code) whenever you resolve an organization ID from an organization slug for RBAC/enterprise authorization scope, always read from the primary Prisma client (`prisma`), not `$replica`. Using `$replica` can hit replica-lag and cause the RBAC lookup/authorization to run without the correct org scope (bypassing intended role enforcement). Implement the slug→org lookup with `prisma.organization.findFirst(...)` (or equivalent primary-client query) and add an inline comment documenting why the primary client is required (replica lag could lead to unscoped RBAC checks).

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-06-23T13:04:21.413Z
Learnt from: carderne
Repo: triggerdotdev/trigger.dev PR: 4023
File: apps/webapp/app/services/upsertBranch.server.ts:14-18
Timestamp: 2026-06-23T13:04:21.413Z
Learning: In TypeScript, it’s valid to `import { type X }` and then use `typeof X` in a type-only position, e.g. `type Alias = z.infer<typeof X>`. The `type` modifier suppresses the runtime import, but the type checker still has the full exported type so `z.infer<typeof X>` can resolve correctly. In code reviews, don’t flag this as a TypeScript compile error as long as `typeof X` is used in a type context (e.g., with `z.infer`, `type` aliases, generics), not as a runtime value.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-05-07T12:25:18.271Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3531
File: apps/webapp/test/sentryTraceContext.server.test.ts:9-47
Timestamp: 2026-05-07T12:25:18.271Z
Learning: In the triggerdotdev/trigger.dev webapp test suite, it is acceptable to leave `createInMemoryTracing()` calls that register a global `NodeTracerProvider` without `afterEach`/`afterAll` teardown. Do not flag this as a test-ordering risk when the code follows the established pattern used across webapp tests (e.g., replication service/benchmark/backfiller tests). This is considered safe because `trace.getActiveSpan()` when called outside a `context.with(...)` block reads `AsyncLocalStorage.getStore()` (undefined when no `run()` scope exists), so it falls back to `ROOT_CONTEXT` with no attached span—regardless of which provider is registered.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-05-28T20:02:10.647Z
Learnt from: myftija
Repo: triggerdotdev/trigger.dev PR: 3772
File: apps/webapp/test/findOrCreateBackgroundWorker.test.ts:1-1
Timestamp: 2026-05-28T20:02:10.647Z
Learning: In the triggerdotdev/trigger.dev monorepo, for the `apps/webapp` package use the established convention of storing Vitest tests (unit, integration, and e2e) under `apps/webapp/test/` rather than colocating them next to source files. Do not flag files located in `apps/webapp/test/` as violating any rule that says to colocate tests with source.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-07-30T18:43:56.874Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 4426
File: apps/webapp/test/memberDevEnvironments.server.test.ts:124-125
Timestamp: 2026-07-30T18:43:56.874Z
Learning: In the `apps/webapp` test suite (`apps/webapp/test/**`), respect the established test harness in `apps/webapp/test/setup.ts`: it loads `.env` and provides default values for required environment variables so that transitive imports (e.g., `~/env.server`) work without production-style wiring.

During code review, do not require dependency injection/refactoring solely to avoid this existing import path. Only introduce configuration injection if it delivers production-level value (for example, a more general `createEnvironment` abstraction that improves runtime behavior beyond test setup).

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-08T12:49:17.489Z
Learnt from: kathiekiwi
Repo: triggerdotdev/trigger.dev PR: 4525
File: apps/webapp/test/dashboardAgentWatchAlertOwnerScope.test.ts:101-109
Timestamp: 2026-08-08T12:49:17.489Z
Learning: In apps/webapp/test, every test suite that creates a client with createDashboardAgentDb(connectionUri, ...) must close the DashboardAgentDbClient in afterEach. Although postgresTest drops cloned databases with WITH (FORCE), it does not clean up client-side postgres-js pool sockets or idle timers, so explicitly closing the client prevents resource leaks and test interference.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-05-12T21:04:05.815Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3542
File: apps/webapp/app/components/sessions/v1/SessionStatus.tsx:1-3
Timestamp: 2026-05-12T21:04:05.815Z
Learning: In this Remix + TypeScript codebase, do not flag a server/client boundary violation when a file imports only types from a module matching `*.server`.

Specifically, it’s safe to import types using `import type { Foo } from "*.server"` or `import { type Foo } from "*.server"` because TypeScript erases type-only imports at compile time and they emit no JavaScript, so they won’t cross the Remix server/client bundle boundary.

Only raise the boundary concern for value imports (e.g., `import { Foo }` without `type`, or `import Foo`), since those produce JavaScript output.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-06-25T18:21:51.905Z
Learnt from: carderne
Repo: triggerdotdev/trigger.dev PR: 4039
File: apps/webapp/app/routes/invite-revoke.tsx:0-0
Timestamp: 2026-06-25T18:21:51.905Z
Learning: During the Zod v4 migration in the triggerdotdev/trigger.dev webapp, ensure any imports from `conform-to/zod` use the Zod-4 subpath: `conform-to/zod/v4` (e.g., `import { parseWithZod } from "conform-to/zod/v4"`). Do not import from the package root `conform-to/zod`, because it is the Zod 3 implementation and may load Zod-3-only symbols (e.g., `ZodBranded`, `ZodEffects`), which can throw at module load (notably with `zod4.4.3`). This should be enforced across `apps/webapp/**/*` where helpers like `parseWithZod` and `conformZodMessage` are used.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-07-03T17:10:21.498Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 4148
File: apps/webapp/app/models/orgMember.server.ts:149-168
Timestamp: 2026-07-03T17:10:21.498Z
Learning: In triggerdotdev/trigger.dev, `User.email` (Prisma schema: `internal-packages/database/prisma/schema.prisma`) currently does NOT use `citext` and does NOT have a `lower(email)` functional unique index. Therefore, do not introduce Prisma queries like `where: { email: { equals: <value>, mode: "insensitive" } }` (or any case-insensitive lookup) against `User.email`, because it can force sequential scans of the `users` table under load. During review, ensure email is normalized (e.g., lowercased/trimmed) before both writes and subsequent lookups, and if true case-insensitive behavior/uniqueness is required, implement it via a separate app-wide migration (e.g., switch to `citext` and/or add a functional unique index with backfill) rather than bolting it onto individual feature PRs.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-06-04T18:16:35.386Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3836
File: apps/supervisor/src/backpressure/backpressureMonitor.ts:3-5
Timestamp: 2026-06-04T18:16:35.386Z
Learning: When reviewing TypeScript in this repo, apply the rule “prefer type aliases over interfaces” only to data/object shapes and union/intersection type modeling. If an interface is being used as a behavioral contract for collaborators to implement (e.g., method-shape interfaces that define required behavior, such as `BackpressureLogger` / `BackpressureSignalSource` in `apps/supervisor/src/backpressure/backpressureMonitor.ts`), keep it as an `interface` and do not flag it as a type-alias-vs-interface violation.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-06-09T17:58:04.699Z
Learnt from: 0ski
Repo: triggerdotdev/trigger.dev PR: 3879
File: apps/webapp/app/models/vercelIntegration.server.ts:619-630
Timestamp: 2026-06-09T17:58:04.699Z
Learning: In this codebase, outbound raw `fetch` calls should typically rely on Node/undici’s default request timeout (about ~300s) rather than adding a per-call `AbortController` + `setTimeout` wrapper inside individual functions (e.g. in files like `apps/webapp/app/models/vercelIntegration.server.ts`). During code review, do not flag the absence of a per-call timeout on a single `fetch` as an issue; if per-call timeouts are needed, they should be implemented via a codebase-wide convention (e.g., a shared fetch wrapper or documented pattern) rather than ad-hoc per-function changes.

Applied to files:

  • apps/webapp/test/helpers/sessionStream.ts
  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-08T08:31:00.265Z
Learnt from: kathiekiwi
Repo: triggerdotdev/trigger.dev PR: 4525
File: apps/webapp/app/routes/api.v1.dashboard-agent.watches.$watchId.check.ts:159-169
Timestamp: 2026-08-08T08:31:00.265Z
Learning: For dashboard-agent watch checks, the single-watch lifecycle in `internal-packages/dashboard-agent/src/watch-lifecycle.ts` claims the watch row before it calls `apps/webapp/app/routes/api.v1.dashboard-agent.watches.$watchId.check.ts`. If a non-final check is unavailable, the lifecycle persists `{ checkFailed: true, detail, previous: claimed.lastResult }`. `previousCheckFacts` in `apps/webapp/app/services/dashboardAgentWatchChecks.ts` recursively unwraps `previous`, so queue-streak facts survive unavailable reads. The batch evaluator uses `recordWatchAttempt` instead because it does not hold a claimed prior row to preserve.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-11T22:35:36.915Z
Learnt from: kathiekiwi
Repo: triggerdotdev/trigger.dev PR: 4556
File: apps/webapp/app/services/dashboardAgentWatches.server.ts:364-375
Timestamp: 2026-08-11T22:35:36.915Z
Learning: In `apps/webapp/app/services/dashboardAgentWatches.server.ts`, `resolveWatchPlanLimits` currently resolves watcher limits to the unlimited sentinel until cloud ships real plan limits. The non-atomic organization active-watch count and `createWatch` sequence is accepted temporarily because finite watcher quotas are not currently enforced. TRI-12863 tracks an organization-scoped atomic guard and concurrent-create test before finite limits are enabled.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-11T22:36:04.162Z
Learnt from: kathiekiwi
Repo: triggerdotdev/trigger.dev PR: 4556
File: apps/webapp/test/dashboardAgentWatchLimitStatus.test.ts:22-55
Timestamp: 2026-08-11T22:36:04.162Z
Learning: In `apps/webapp/test/dashboardAgentWatchLimitStatus.test.ts`, route-level tests may use narrow Vitest module seams to provide authentication, access control, and deterministic plan-limit configuration when the test uses `postgresTest` with real Prisma seeding and a real dashboard-agent database client. Do not flag these seams as Testcontainers violations when the test verifies a route response and container-backed persistence behavior remains real.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-08T08:30:26.149Z
Learnt from: kathiekiwi
Repo: triggerdotdev/trigger.dev PR: 4525
File: apps/webapp/app/components/dashboard-agent/DashboardAgentChat.tsx:292-301
Timestamp: 2026-08-08T08:30:26.149Z
Learning: In `apps/webapp/app/components/dashboard-agent/DashboardAgentChat.tsx`, `onWatchIntent` maps to `openWatchCard` in `apps/webapp/app/components/dashboard-agent/DashboardAgentPanel.tsx`. `openWatchCard` stores one draft with `setWatchDraft(watchDraftFor(spec))`. When one transcript update contains multiple watch intents, `pending.at(-1)` is intentional because only the final watch draft can be displayed.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-12T07:30:40.534Z
Learnt from: kathiekiwi
Repo: triggerdotdev/trigger.dev PR: 4525
File: internal-packages/dashboard-agent-db/src/watch-queries.ts:794-808
Timestamp: 2026-08-12T07:30:40.534Z
Learning: In triggerdotdev/trigger.dev dashboard-agent watches, `softDeleteChatsForOrganization()` does not serialize with `createWatch()` through the per-chat advisory lock. A create-versus-organization-delete race can temporarily leave an active watch on a deleted chat. This behavior existed before the Watch feature and is accepted as a bounded, rare administrative-path condition: the next watch tick calls `authorizeWatchEnvironment`, cancels the watch with `access_lost` after organization deletion, and chat hard deletion removes residual watch rows. Per-chat or organization-level locking and a concurrent regression test belong to the dedicated organization-deletion durability follow-up.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-12T06:32:26.470Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 4577
File: apps/webapp/app/v3/services/createBackgroundWorker.server.ts:779-781
Timestamp: 2026-08-12T06:32:26.470Z
Learning: In `apps/webapp/app/v3/services/createBackgroundWorker.server.ts`, `syncDeclarativeSchedules` has a pre-existing non-serialized read/modify/delete reconciliation flow. Changes that reuse its initial schedule snapshot instead of a redundant re-fetch do not introduce this concurrency risk. Track reconciliation serialization separately from read-side performance changes unless a change modifies the synchronization boundary.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-07-18T18:31:37.633Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 4285
File: internal-packages/run-store/src/runOpsStore.presentersWaitpointReadView.replicaLag.test.ts:24-65
Timestamp: 2026-07-18T18:31:37.633Z
Learning: In `triggerdotdev/trigger.dev`’s `internal-packages/run-store/src/runOpsStore.presentersWaitpointReadView.replicaLag.test.ts`, retain the local real-Testcontainers Prisma proxy rather than requiring the shared `laggingReplica` helper: the test must simulate lag for `waitpointTag` reads and for `findWaitpointConnectedRunIds`, which uses `$queryRaw`. The shared primitive intercepts configured Prisma models but not raw queries, so replacing the proxy would allow the live raw join to observe primary data and invalidate the replica-lag guard. The related taskRun-only tests (`runOpsStore.realtimeServicesReadView.replicaLag.test.ts`, `runOpsStore.replayReadAfterWrite.replicaLag.test.ts`, and `runOpsStore.resolveRunForMutationReplicaLag.test.ts`) can use the shared primitive with `{ model: "taskRun", mode: "missing" }`.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-08T17:53:09.522Z
Learnt from: kathiekiwi
Repo: triggerdotdev/trigger.dev PR: 4525
File: apps/webapp/app/components/dashboard-agent/turn-teardown.test.ts:0-0
Timestamp: 2026-08-08T17:53:09.522Z
Learning: In `apps/webapp/app/components/dashboard-agent/turn-teardown.ts`, `unmountTeardown` accepts pathname values and compares them directly. Its call sites pass `location.pathname`, so query strings cannot reach this helper. Query-string behavior must be tested at the call site, not in `unmountTeardown`.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-08-08T12:22:37.742Z
Learnt from: kathiekiwi
Repo: triggerdotdev/trigger.dev PR: 4525
File: internal-packages/dashboard-agent/src/watch-actions.ts:564-590
Timestamp: 2026-08-08T12:22:37.742Z
Learning: In `internal-packages/dashboard-agent/src/watch-actions.ts`, consented watch investigations must use `watchInvestigationId(action.watchId)` in the wake, investigation, and redelivery paths. Do not use a chat-wide open-investigation lookup because it can associate a watch with a manually started or sibling-watch investigation card.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-07-13T14:51:32.938Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: packages/redis-worker/CLAUDE.md:0-0
Timestamp: 2026-07-13T14:51:32.938Z
Learning: Applies to packages/redis-worker/src/queue.ts : Implement the Redis-backed job queue abstraction in `src/queue.ts`.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-05-18T14:40:02.173Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3658
File: packages/core/src/v3/realtimeStreams/manager.test.ts:1-147
Timestamp: 2026-05-18T14:40:02.173Z
Learning: In the triggerdotdev/trigger.dev repo, the policy “Never mock anything — use testcontainers instead” should only be enforced for integration tests that interact with real external services (e.g., Redis, Postgres) via actual infrastructure. For unit tests that exercise pure in-memory logic (e.g., cache semantics) it is OK to stub collaborators such as `ApiClient` using Vitest (`vi.fn()`) to assert call counts or control behavior. Do not flag `vi.fn()`-based `ApiClient` stubs in unit tests as violations of the testcontainers policy.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
📚 Learning: 2026-06-16T09:19:47.637Z
Learnt from: d-cs
Repo: triggerdotdev/trigger.dev PR: 3960
File: apps/webapp/test/prismaInfrastructureErrorCapture.test.ts:0-0
Timestamp: 2026-06-16T09:19:47.637Z
Learning: In this repo’s Vitest setup, `vitest.config.ts` uses `globals: true`, so identifiers like `vi`, `describe`, `it`, and `expect` are available as globals in Vitest test files. During code review, do not flag missing `vi`/`describe`/`it`/`expect` imports as a runtime error or correctness issue when they’re used in `*.test.ts/tsx` or `*.spec.ts/tsx` files. Explicit imports are still preferred for consistency, but they’re not required for runtime behavior.

Applied to files:

  • apps/webapp/test/dashboardAgentWatchQueueName.test.ts
🔇 Additional comments (4)
apps/webapp/test/dashboardAgentWatchQueueName.test.ts (1)

183-192: LGTM!

.oxlintrc.json (1)

3-5: LGTM!

Also applies to: 38-38

apps/webapp/seed-queue-metrics.mts (1)

4-10: LGTM!

apps/webapp/test/helpers/sessionStream.ts (1)

277-277: LGTM!


Walkthrough

Oxlint now treats the correctness category as an error category and reports no-unused-expressions as an error. Targeted suppressions cover intentional default imports and an infinite loop. The persistedQueueName helper now checks for a created watch ID and a persisted watch record before returning the queue name.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided, so the required checklist, testing details, changelog, and screenshots sections are missing. Add the required template sections, complete the checklist, describe testing steps, summarize the changes, and provide screenshots or state that they are not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the lint configuration changes and targeted code updates that resolve lint warnings.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-lint-warnings

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

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

@carderne
carderne marked this pull request as ready for review August 13, 2026 14:01
@carderne
carderne enabled auto-merge (squash) August 13, 2026 14:07

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

Open in Devin Review

Comment thread apps/webapp/seed-queue-metrics.mts
@carderne
carderne merged commit 20a0ac5 into main Aug 13, 2026
39 checks passed
@carderne
carderne deleted the fix-lint-warnings branch August 13, 2026 16:26
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.

2 participants