CI Race Condition & TypeError Fixed in Hybrid Backend
This patch release addresses two critical issues in the hybrid backend that were causing spurious test failures in GitHub Actions CI environments.
Fixed
CI Race Condition
- Eliminates "Task was destroyed but pending" warnings in GitHub Actions Linux CI
- Properly tracks and cancels
_initial_sync_taskduring shutdown - Tests would sometimes finish before background sync task was properly cancelled
- Issue manifested on Linux CI but not Windows due to timing differences
TypeError in Stats Comparison
- Handles None values in
total_memoriesstats (not just missing keys) - Cloudflare backend can return
{'total_memories': None}in edge cases - Changed
.get('total_memories', 0)to.get('total_memories') or 0(5 locations) - Default value
0only applies to missing keys, not None values
Impact
- Improved test stability in CI/CD pipelines
- Enhanced hybrid backend robustness for edge cases
- Cleaner shutdown process with proper async task cleanup
Files Changed
src/mcp_memory_service/storage/hybrid.py- Added task tracking, fixed stats comparison (5 locations)