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

@@ -186,9 +186,10 @@ class AniWorldApp {
console.log('Connected to server');
// Subscribe to rooms for targeted updates
this.socket.join('scan_progress');
this.socket.join('download_progress');
// Valid rooms: downloads, queue, scan, system, errors
this.socket.join('scan');
this.socket.join('downloads');
this.socket.join('queue');
this.showToast(this.localization.getText('connected-server'), 'success');
this.updateConnectionStatus();

View File

@@ -32,8 +32,9 @@ class QueueManager {
console.log('Connected to server');
// Subscribe to rooms for targeted updates
// Valid rooms: downloads, queue, scan, system, errors
this.socket.join('downloads');
this.socket.join('download_progress');
this.socket.join('queue');
this.showToast('Connected to server', 'success');
});