Skip to content

v0.2.1: Critical DateTimeImmutable Null Value Fix

Choose a tag to compare

@iampersistent iampersistent released this 07 Aug 01:51
· 15 commits to main since this release

🚨 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/updatedAt fields
  • 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 implementation
  • tests/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-adapter

No 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