test(sports): cover P1017 from person.findUnique in linkSquadPerson (BIT-32481) #282

Merged
spark merged 1 commits from task/BIT-32481-p1017-linkSquadPerson-test into main 2026-11-19 13:38:45 +00:00
Owner

What

Regression test for BIT-32481: P1017 ("Server has closed the connection.") from linkSquadPerson → person.findUnique (the organizationId_sportsPlayerId lookup, the first DB call in the method).

Why

The fix is already in main:

  • BIT-32460 — retryOnConnectionClosed wraps syncEventSquadsNow, retrying once on P1017 with a fresh client.
  • BIT-32475 — isPrismaConnectionClosed catch downgrades the exhausted retry to info instead of rejecting to the archive caller's warn and paging the error loop.

The existing BIT-32475 test covers P1017 from person.findFirst (the FPA licence lookup). This PR adds the same coverage for person.findUnique (the organizationId_sportsPlayerId lookup) — the exact call in the BIT-32481 stack trace.

Test

  • vitest run src/sports/service.test.ts — 9 passed
  • vitest run src/lib/pg.test.ts — 18 passed
  • tsc --noEmit — clean

Paperclip-Issue: BIT-32481
Paperclip-Cluster: 9a675e2734df

## What Regression test for BIT-32481: P1017 ("Server has closed the connection.") from `linkSquadPerson` → `person.findUnique` (the `organizationId_sportsPlayerId` lookup, the first DB call in the method). ## Why The fix is already in `main`: - **BIT-32460** — `retryOnConnectionClosed` wraps `syncEventSquadsNow`, retrying once on P1017 with a fresh client. - **BIT-32475** — `isPrismaConnectionClosed` catch downgrades the exhausted retry to `info` instead of rejecting to the archive caller's `warn` and paging the error loop. The existing BIT-32475 test covers P1017 from `person.findFirst` (the FPA licence lookup). This PR adds the same coverage for `person.findUnique` (the `organizationId_sportsPlayerId` lookup) — the exact call in the BIT-32481 stack trace. ## Test - `vitest run src/sports/service.test.ts` — 9 passed - `vitest run src/lib/pg.test.ts` — 18 passed - `tsc --noEmit` — clean Paperclip-Issue: BIT-32481 Paperclip-Cluster: 9a675e2734df
spark added 1 commit 2026-11-19 13:29:33 +00:00
test(sports): cover P1017 from person.findUnique in linkSquadPerson (BIT-32481)
ci / rust (pull_request) Successful in 3m47s
ci / typescript (pull_request) Successful in 8m48s
8daa66573d
The error loop reported P1017 ("Server has closed the connection.") from
linkSquadPerson → person.findUnique (the organizationId_sportsPlayerId
lookup). The fix is already in main: retryOnConnectionClosed (BIT-32460)
retries once on a fresh client, and isPrismaConnectionClosed (BIT-32475)
downgrades the exhausted retry to info instead of paging the error loop.
This adds a regression test for the findUnique path (the existing BIT-32475
test covers findFirst).

Paperclip-Issue: BIT-32481
Paperclip-Cluster: 9a675e2734df
spark merged commit 2e6be068f5 into main 2026-11-19 13:38:45 +00:00
Sign in to join this conversation.