fix(ops): close the type-argument list that made the dead-letter read a comparison (#7095)
`findDeadMessages` opened two type-argument lists — `$queryRaw<` and `Array<` — and closed only one before `(`. That is not a syntax error: TypeScript falls back to parsing the whole expression as a `<` comparison, so the emitted JavaScript is `$queryRaw < Array(sql)`. The query never reached Postgres, `rows` was a boolean, and every load of /ops/event-sourcing/dead-letters died on `rows.map is not a function` in 3ms, surfacing as a spinner (react-query retrying) and then a generic "unknown error" header. `pnpm typecheck` could not catch it, because a comparison typechecks. The existing coverage is integration-only, so the guard added here is a unit test that calls both dead-letter reads against a stubbed Prisma and asserts on what came back — it fails with the production `TypeError` on the unfixed code and runs on every change. Swept every other `$queryRaw`/`$executeRaw` site in the app by comparing the emitted JavaScript; this was the only one affected. The SQL itself was validated against a real Postgres schema — it had never executed before.
A
Alexander Forbes-Reed committed
60fa445a3e320bc7d281d3f650ee3fc4a7d3cea6
Parent: 18f4edb
Committed by GitHub <noreply@github.com>
on 8/17/2026, 5:40:57 AM