Repository navigation
v0.2.1: Critical DateTimeImmutable Null Value Fix
π¨ Critical Bug Fix Release
This release fixes a critical bug that completely blocked EdgeBinder relationship functionality when Weaviate returned null timestamp values.
π§ What's Fixed
DateTimeImmutable Null Value Error
- Problem:
TypeError: DateTimeImmutable::__construct(): Argument #1 ($datetime) must be of type string, null given - Impact: All EdgeBinder relationship queries were failing (
findProfileWorkspaces(),findOrganizationMembers(),isOrganizationMember(),isWorkspaceOwner()) - Root Cause: Weaviate was returning null values for
createdAt/updatedAtfields - Solution: Added robust null-safety checks with graceful fallbacks
β¨ Key Improvements
Robust Timestamp Handling
- β Null Safety: Handles null timestamp values gracefully
- β Empty String Handling: Manages empty string timestamps
- β Malformed Date Handling: Catches and handles invalid date formats
- β Missing Property Handling: Works when timestamp properties are missing entirely
- β Graceful Fallbacks: Uses current timestamp when data is invalid
Enhanced Error Handling
- Added
parseDateTime()helper method with comprehensive error handling - Proper exception catching for malformed timestamp strings
- Maintains existing behavior for valid timestamps
Comprehensive Test Coverage
- 6 new test methods covering all edge cases
- Tests for null, empty, malformed, and missing timestamps
- Ensures robust behavior across all scenarios
Code Quality Improvements
- Fixed all PHPStan static analysis issues
- Improved resource type safety
- Cleaned up unused methods and imports
π Backward Compatibility
- β No API Changes: Existing code continues to work unchanged
- β No Breaking Changes: Maintains all existing functionality
- β Graceful Degradation: Invalid data handled with sensible defaults
- β Drop-in Replacement: Can be upgraded without code changes
π Technical Details
Files Changed
src/Mapping/BindingMapper.php- Core fix implementationtests/Unit/Mapping/BindingMapperTest.php- Comprehensive test coverage- Multiple test files - PHPStan fixes and cleanup
Test Results
- β All 192 unit tests passing
- β All 14 integration tests passing
- β PHPStan static analysis clean
- β No regressions introduced
π Upgrade Instructions
composer update edgebinder/weaviate-adapterNo code changes required - this is a drop-in replacement that fixes the critical bug while maintaining full backward compatibility.
π― Impact
This release restores full EdgeBinder relationship functionality. All relationship queries that were previously failing with TypeError will now work correctly, even when Weaviate returns null or malformed timestamp data.
Full Changelog: v0.2.0...v0.2.1