Skip to content

fix(typescript): classify connection failures#252

Merged
NikolayS merged 1 commit into
mainfrom
fix-ts-connection-errors
May 25, 2026
Merged

fix(typescript): classify connection failures#252
NikolayS merged 1 commit into
mainfrom
fix-ts-connection-errors

Conversation

@NikolayS
Copy link
Copy Markdown
Owner

Summary

Fix REV rerun finding: TypeScript classified operation-time pool/network failures as generic PgqueSqlError, despite PgqueConnectionError documenting mid-operation drops and Go tagging non-PgError operation failures as connection errors.

  • classify common Node/pg connection failures as PgqueConnectionError
  • cover closed pool, terminated connection, and ECONNRESET with in-memory regression tests

Test

  • cd clients/typescript && bun run check && bun run test (33 passed, 50 skipped locally without PGQUE_TEST_DSN)
  • git diff --check

REV

REV rerun finding from #251: #251 (comment)

@NikolayS
Copy link
Copy Markdown
Owner Author

REV

Scope: TypeScript client parity/code review only. SOC2/compliance checklist skipped.

Finding addressed

REV rerun found that TypeScript still classified operation-time connection/pool failures as PgqueSqlError, while:

  • PgqueConnectionError documents mid-operation connection drops.
  • Go maps non-PgError operation failures as connection errors.

Review result

Clean for this focused follow-up.

What changed

  • mapPgError() now returns PgqueConnectionError for common Node/pg connection failures:
    • ECONNRESET
    • ECONNREFUSED
    • EPIPE
    • ETIMEDOUT
    • ENOTFOUND
    • EAI_AGAIN
    • closed/terminated connection and ended pool message fragments
  • Added in-memory regression tests for:
    • Connection terminated unexpectedly
    • Cannot use a pool after calling end on the pool
    • ECONNRESET

Gates

  • cd clients/typescript && bun run check && bun run test → passed (33 passed, 50 skipped locally without PGQUE_TEST_DSN)
  • git diff --check → clean

No remaining blocker found in this patch.

@NikolayS NikolayS merged commit 95f192b into main May 25, 2026
14 checks passed
@NikolayS NikolayS deleted the fix-ts-connection-errors branch May 25, 2026 01:40
@NikolayS NikolayS mentioned this pull request May 25, 2026
22 tasks
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.

1 participant