fix: progress broadcasts now use correct WebSocket room names

- Fixed room name mismatch: ProgressService was broadcasting to
  'download_progress' but JS clients join 'downloads' room
- Added _get_room_for_progress_type() mapping function
- Updated all progress methods to use correct room names
- Added 13 new tests for room name mapping and broadcast verification
- Updated existing tests to expect correct room names
- Fixed JS clients to join valid rooms (downloads, queue, scan)
This commit is contained in:
2025-12-16 19:21:30 +01:00
parent 4c9bf6b982
commit 700f491ef9
7 changed files with 490 additions and 17 deletions

View File

@@ -180,9 +180,9 @@ class TestDownloadProgressIntegration:
connection_id = "test_client_1"
await websocket_service.connect(mock_ws, connection_id)
# Join the queue_progress room to receive queue updates
# Join the queue room to receive queue updates
await websocket_service.manager.join_room(
connection_id, "queue_progress"
connection_id, "queue"
)
# Subscribe to progress events and forward to WebSocket
@@ -254,12 +254,12 @@ class TestDownloadProgressIntegration:
await websocket_service.connect(client1, "client1")
await websocket_service.connect(client2, "client2")
# Join both clients to the queue_progress room
# Join both clients to the queue room
await websocket_service.manager.join_room(
"client1", "queue_progress"
"client1", "queue"
)
await websocket_service.manager.join_room(
"client2", "queue_progress"
"client2", "queue"
)
# Subscribe to progress events and forward to WebSocket