MAESTRO: Verify backend WebSocket download progress event wiring is complete

Confirmed all event bus wiring between DownloadService, WebSocket route,
and server builder is correctly connected. No changes needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
John Lightner 2026-04-01 00:42:34 -05:00
parent f5dbf05870
commit 57626f5f01

View file

@ -32,12 +32,13 @@ The backend event bus, WebSocket route, progress parser, and frontend context/ho
- Use existing CSS variables (`--success` for connected, `--text-muted` for disconnected)
- **Done:** Added connection status indicator at bottom of sidebar with green/grey dot and "Connected"/"Disconnected" label. Collapses to just the dot when sidebar is collapsed. Uses `useDownloadProgressConnection` hook.
- [ ] Verify the backend emits progress events during streaming downloads:
- [x] Verify the backend emits progress events during streaming downloads:
- Read `src/services/download.ts` to confirm the `spawnDownload` method emits `download:progress` events via the event bus
- Read `src/server/routes/websocket.ts` to confirm the WebSocket route subscribes to the event bus and broadcasts to clients
- Read `src/server/index.ts` to confirm the event bus is passed to both the WebSocket route plugin and the server builder
- If any wiring is missing between `buildServer()` and the WebSocket route registration, fix it
- Verify the `--newline` and `--progress` flags are added to yt-dlp args in `spawnDownload` (they should already be there)
- **Verified:** All wiring is correct. Single `DownloadEventBus` instance created in `src/index.ts:61` is shared between `buildServer` (→ WebSocket route) and `DownloadService`. `spawnDownload` adds `--newline`/`--progress` flags, parses progress lines, and emits all three event types. WebSocket route subscribes and broadcasts to clients. All 13 related tests pass.
- [ ] Invalidate relevant queries on WebSocket events for immediate UI freshness:
- Read the `DownloadProgressContext.tsx` — it already invalidates `content` and `queue` query keys on `download:complete` and `download:failed`