fix(reporter): suppress transient PostgreSQL shutdown/restart errors from the hub (BIT-32490) #284

Merged
spark merged 1 commits from task/BIT-32490-reporter-transient-db-filter into main 2026-11-20 06:06:04 +00:00
Owner

What

A database restart surfaces 57P01/57P03/P1001/P1017 through every code path that touches Prisma during the brief outage. The per-call-site guards in lib/pg.ts (BIT-32448–BIT-32475) cover the hot paths (syncEventSquads, rematch, takeOffFutureGames, linkStoredSquads) but 12 more paths logged the error and tripped the Error Loop with one-off incidents.

This adds a global filter in ErrorReporter.reportError that skips transient DB errors before they reach errors.bitreport.pt. Call-site guards that need to stop a batch or retry are unaffected — they still catch the error first. The log line still reaches the console; only the hub report is suppressed.

Test

  • apps/api/test/reporter.test.ts: 6/6 pass (new test verifies 57P01/57P03/P1001/P1017 are not sent to the hub)
  • pnpm -r typecheck: clean
  • Other API test failures are pre-existing (no test PostgreSQL available in this runner)

Issues closed

BIT-32490, BIT-32489, BIT-32488, BIT-32487, BIT-32486, BIT-32485, BIT-32484, BIT-32482, BIT-32480, BIT-32478, BIT-32477, BIT-32476

## What A database restart surfaces `57P01`/`57P03`/`P1001`/`P1017` through every code path that touches Prisma during the brief outage. The per-call-site guards in `lib/pg.ts` (BIT-32448–BIT-32475) cover the hot paths (`syncEventSquads`, `rematch`, `takeOffFutureGames`, `linkStoredSquads`) but 12 more paths logged the error and tripped the Error Loop with one-off incidents. This adds a global filter in `ErrorReporter.reportError` that skips transient DB errors before they reach `errors.bitreport.pt`. Call-site guards that need to stop a batch or retry are unaffected — they still catch the error first. The log line still reaches the console; only the hub report is suppressed. ## Test - `apps/api/test/reporter.test.ts`: 6/6 pass (new test verifies 57P01/57P03/P1001/P1017 are not sent to the hub) - `pnpm -r typecheck`: clean - Other API test failures are pre-existing (no test PostgreSQL available in this runner) ## Issues closed BIT-32490, BIT-32489, BIT-32488, BIT-32487, BIT-32486, BIT-32485, BIT-32484, BIT-32482, BIT-32480, BIT-32478, BIT-32477, BIT-32476
spark added 1 commit 2026-11-20 05:54:07 +00:00
fix(reporter): suppress transient PostgreSQL shutdown/restart errors from the hub (BIT-32490)
ci / rust (pull_request) Successful in 4m32s
ci / typescript (pull_request) Successful in 10m28s
ae47a3f703
A database restart surfaces 57P01/57P03/P1001/P1017 through every code path
that touches Prisma during the brief outage. The per-call-site guards in
lib/pg.ts (BIT-32448–BIT-32475) cover the hot paths (syncEventSquads, rematch,
takeOffFutureGames, linkStoredSquads) but 12 more paths logged the error and
tripped the Error Loop with one-off incidents. Add a global filter in
ErrorReporter.reportError that skips transient DB errors before they reach
errors.bitreport.pt. Call-site guards that need to stop a batch or retry are
unaffected — they still catch the error first. The log line still reaches the
console; only the hub report is suppressed.

Paperclip-Issue: BIT-32490
Paperclip-Cluster: fdbb0d3da1af
spark merged commit 7c0e92b5ae into main 2026-11-20 06:06:04 +00:00
Sign in to join this conversation.