- Fix brittle test assertion on line 264: make key/value checks always required instead of conditional
- Add toMatchInlineSnapshot() for syntax error message test on line 334 as suggested
Addresses all remaining review feedback from @alii.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive mapping of PostgreSQL error codes to condition names using StaticStringMap
- Add 'condition' field to PostgresError with human-readable condition names
- Add parsed detail fields for 4 major PostgreSQL error types:
* Unique violations (23505): key, value
* Foreign key violations (23503): key, value, referenced_table
* Not null violations (23502): failing_column
* Check violations (23514): check_constraint, failing_table
- Support all standard PostgreSQL error codes from documentation (200+ codes)
- Use efficient StaticStringMap for O(1) error code lookups
- Replace magic numbers with named constants for better maintainability
- Remove unit tests that didn't test actual functionality (as requested by reviewers)
- Add comprehensive integration tests for all supported error types
- Extend parsing beyond just unique constraints to cover major error categories
- Add edge case handling and comprehensive test coverage
This addresses all review feedback:
✅ "Remove this test" / "useless tests" - Deleted non-functional unit tests
✅ "are there other error codes we can attach info for?" - Extended to 4 error types with structured parsing
✅ "feels incomplete currently" - Now comprehensive with extensible architecture
The implementation now provides structured error detail parsing for the major PostgreSQL
error categories with proper test coverage and extensible design for future error types.
Performance: O(1) error code lookups, compile-time map generation, zero runtime overhead
Fixes#21698🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
### What does this PR do?
We should not call .deinit() after .toJS otherwise hasPendingActivity
will access invalid memory
### How did you verify your code works?
Test run it with debug build on macos or asan on and will catch it
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
### What does this PR do?
Fix: https://github.com/oven-sh/bun/issues/21351
Relevant changes:
Fix advance to properly cleanup success and failed queries that could be
still be in the queue
Always ref before executing
Use stronger atomics for ref/deref and hasPendingActivity
Fallback when thisValue is freed/null/zero and check if vm is being
shutdown
The bug in --hot in `resolveRopeIfNeeded` Issue is not meant to be fixed
in this PR this is a fix for the postgres regression
Added assertions so this bug is easier to catch on CI
### How did you verify your code works?
Test added
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>