Fix async loading bugs and add test results

Critical Fixes:
- Fix async context manager usage in fastapi_app.py (async for -> async with)
- Add broadcast() method to WebSocketService
- Initialize BackgroundLoaderService properly in lifespan function

Testing:
- Execute manual testing (Tests 1, 5, 8, 9)
- Create comprehensive test results document
- Verify API endpoints return 202 Accepted
- Confirm database persistence works
- Validate startup incomplete series check

Test Results:
- Response time: 61ms (target: < 500ms) 
- 4 series found with missing data on startup
- Database fields properly persisted
- All critical bugs fixed

Files:
- check_db.py: Database inspection utility
- docs/MANUAL_TESTING_RESULTS.md: Comprehensive test results
- src/server/fastapi_app.py: Fixed async context manager, initialized BackgroundLoaderService
- src/server/services/websocket_service.py: Added broadcast() method
This commit is contained in:
2026-01-19 08:49:28 +01:00
parent 8b0a4abca9
commit 0bbdd46fc7
6 changed files with 413 additions and 82 deletions

View File

@@ -443,6 +443,14 @@ class WebSocketService:
"""Disconnect a WebSocket client."""
await self._manager.disconnect(connection_id)
async def broadcast(self, message: Dict[str, Any]) -> None:
"""Broadcast a message to all connected clients.
Args:
message: Dictionary message to broadcast to all clients
"""
await self._manager.broadcast(message)
async def broadcast_download_progress(
self, download_id: str, progress_data: Dict[str, Any]
) -> None: