* Add test demonstrating nil GlobalConfig panic in newRefreshConnectionState
Test: TestRefreshConnectionState_ConnectionOrderEdgeCases
Demonstrates issue #4779 where nil GlobalConfig causes panic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add nil check for GlobalConfig in newRefreshConnectionState
Fixes#4779: nil GlobalConfig causes panic in newRefreshConnectionState
Changes:
- Add nil check for GlobalConfig in newRefreshConnectionState before SetUserSearchPath
- Add nil check in getDefaultSearchPath to handle nil GlobalConfig gracefully
- Test now passes instead of panicking with nil pointer dereference
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Add test demonstrating bug #4791: Goroutine leak in executeUpdateSetsInParallel
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix#4791: Use idiomatic for-range pattern for error channel
Replace the for-select-nil-check pattern with the idiomatic for-range
pattern when consuming from the error channel. The for-range pattern:
- Automatically exits when the channel is closed
- Doesn't require manual nil checks
- Is more maintainable and less error-prone
- Follows Go best practices for channel consumption
This eliminates the potential for goroutine leaks if the nil check
were accidentally removed or modified in future maintenance.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Add test for #4807: Potential type assertion panic in logRefreshConnectionResults
Fix test to verify panic is prevented, not expected
The test was written to expect a panic, but after the fix is applied,
the panic should NO LONGER occur. Updated the test to verify that:
1. No panic occurs when handling nil values
2. No panic occurs when handling wrong types
3. No panic occurs when handling nil cobra.Command pointers
This ensures the test passes after the fix is applied.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix#4807: Use safe type assertion in logRefreshConnectionResults
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Add test demonstrating bug #4778 - nil pool causes panic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix#4778: Add nil pool validation in newRefreshConnectionState
Add nil check immediately after retrieving pool from pluginManager
to prevent panic when pool is nil. This addresses the issue where
a nil pool would cause a segmentation fault when passed to
db_local.SetUserSearchPath().
The fix returns a descriptive error instead of panicking, allowing
calling code to handle the error gracefully.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>