GLM-5.3 Flash · Heavy
feat-convert-insightsbookingservice-to-use-prisma-sql-raw-queries-cal-com
cal.com · TypeScript · M · 100–299 lines · 1 files
The generalist plus 9 specialist lens agents in parallel, then the same verify and dedup steps. Judge: Claude Opus 5.5.
- Gold bugs found
- 1 of 3
- Comments published
- 2
- Comments matching a bug
- 1
- Comments not matching
- 1
- Cost of this PR
- $0.206
Published comments (2)
Public options type marks teamId optional, but schema requires it for scope "team" — A call site omitting `teamId` for scope "team" now type-checks but fails `insightsBookingServiceOptionsSchema` validation at runtime, silently degrading to empty results instead of a compile-time error. Split `InsightsBookingServicePublicOptions` into a discriminated union so `scope: "team"` requires `teamId`.
toEqual on composed Prisma.Sql compares internals, not rendered SQL — These assertions can never pass: `toEqual` deep-compares `Prisma.Sql` internals (`strings`/`values`), and fragments composed by `buildTeamAuthorizationCondition` keep nested `Sql` objects inside `values`, never matching the flat literal template. Build the expectation with the same composition the service performs, or assert on `conditions.sql`. **Also found in:** - `packages/lib/server/service/__tests__/insightsBooking.integration-test.ts:332-343` - `packages/lib/server/service/__tests__/insightsBooking.integration-test.ts:429-431`